Commit 0d955981 authored by liguangyu06's avatar liguangyu06
Browse files

用例优化

parent 69b8948b
...@@ -60,7 +60,10 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db") ...@@ -60,7 +60,10 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
# 查询数据库中审核后商品数量 # 查询数据库中审核后商品数量
sql = "SELECT count(t.demandSkuId) FROM `cmdc-order`.tc_demand_sku t WHERE demandCode = {}".format(demandCode) sql = "SELECT count(t.demandSkuId) FROM `cmdc-order`.tc_demand_sku t WHERE demandCode = {}".format(demandCode)
total = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0] total = (
mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0] if mysql_handle.selectSql(host, port, user,
pwd, "cmdc-order",
sql) else 0)
# 将接口响应时间添加至result # 将接口响应时间添加至result
result["api_time"] = api_time result["api_time"] = api_time
...@@ -70,4 +73,3 @@ check_dict = commonFuc().get_business_data(module, "checkDict96", total) ...@@ -70,4 +73,3 @@ check_dict = commonFuc().get_business_data(module, "checkDict96", total)
# print(check_dict) # print(check_dict)
# 断言实际结果中是否包含预期结果的内容 # 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result) commonFuc().check_result(check_dict, result)
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