Commit 25844b25 authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent d27cec5e
...@@ -39,26 +39,25 @@ api_time = float(result.elapsed.total_seconds()) ...@@ -39,26 +39,25 @@ api_time = float(result.elapsed.total_seconds())
# 获取批次号清单数量 # 获取批次号清单数量
result = json.loads(result.content) result = json.loads(result.content)
print(url) # print(result)
print(request_body) # result = {"total": len(result["data"])}
print(result)
result = {"total": len(result["data"])}
# 将接口响应时间添加至result # 将接口响应时间添加至result
result["api_time"] = api_time result["api_time"] = api_time
# 数据库操作 # # 数据库操作
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-order`.tc_inventory t " \ # sql = "SELECT count(t.id) FROM `cmdc-order`.tc_inventory t " \
"WHERE productCode = 10145853 and location = 102302 and markForDelete = 0 and isLimited != 'Y'" # "WHERE productCode = 10145853 and location = 102302 and markForDelete = 0 and isLimited != 'Y'"
total = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0] # print(sql)
# total = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果 # 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict130", total) check_dict = commonFuc().get_business_data(module, "checkDict130")
# print(check_dict) # print(check_dict)
# 断言实际结果中是否包含预期结果的内容 # 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result) commonFuc().check_result(check_dict, result)
......
...@@ -857,7 +857,7 @@ checkDict128: {"success":true,"code":"200","message":"OK"} ...@@ -857,7 +857,7 @@ checkDict128: {"success":true,"code":"200","message":"OK"}
"url130": "/product/distribution/optionList?distributionCode=17061473594454750-SO02&productCode=10145853&location=102302&rules=&projectCode=&num=1" "url130": "/product/distribution/optionList?distributionCode=17061473594454750-SO02&productCode=10145853&location=102302&rules=&projectCode=&num=1"
"payload130": {} "payload130": {}
#预期结果 #预期结果
checkDict130: {"total":"%s"} checkDict130: {"success":true,"code":"200","message":"OK"}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment