Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-cmdc
Commits
ba4026dc
Commit
ba4026dc
authored
Jan 23, 2024
by
liguangyu06
Browse files
优化
parent
ec0ac742
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_product/获取产品线制单员列表.air/获取产品线制单员列表.py
View file @
ba4026dc
...
@@ -13,7 +13,6 @@ import requests
...
@@ -13,7 +13,6 @@ import requests
import
random
import
random
import
json
import
json
module
=
"cmdc_product"
module
=
"cmdc_product"
# 第一步登录
# 第一步登录
...
@@ -54,18 +53,19 @@ result = requests.post(url, json=request_body, headers=headers)
...
@@ -54,18 +53,19 @@ result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
# 获取接口响应时间
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
# 获取制单员数量
# 获取制单员数量
result
=
{
"total"
:
result
[
"data"
][
"total"
]}
result
=
{
"total"
:
result
[
"data"
][
"total"
]}
result
[
"api_time"
]
=
api_time
result
[
"api_time"
]
=
api_time
# print(result)
# 数据库操作
# 数据库操作
mysql_handle
=
mySql
()
mysql_handle
=
mySql
()
# 获取conf.ini文件中配置的数据库信息
# 获取conf.ini文件中配置的数据库信息
host
,
port
,
user
,
pwd
=
mysql_handle
.
getConf
(
db
=
"cmdc_db"
)
host
,
port
,
user
,
pwd
=
mysql_handle
.
getConf
(
db
=
"cmdc_db"
)
# 查询数据库中产品线对应制单员数量
# 查询数据库中产品线对应制单员数量
sql
=
"SELECT count(t.id) FROM `cmdc-product`.ic_marker_member t WHERE userId = 2795 and productLineCode = {}"
.
format
(
product_line_code
)
sql
=
"SELECT count(t.id) FROM `cmdc-product`.ic_marker_member t "
\
"WHERE userId = 2795 and productLineCode = '{}'"
.
format
(
product_line_code
)
total
=
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-product"
,
sql
)[
0
][
0
]
total
=
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-product"
,
sql
)[
0
][
0
]
# 获取预期结果
# 获取预期结果
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment