Commit 6d88e59b authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent 69d430be
......@@ -50,11 +50,20 @@ result = requests.get(url, params=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
# 获取返利明细中demandCode
result = {"demandCode": result["data"][0]["demandCode"]}
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict26", demand_code)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# print(result)
# 历史数据会出现需求单详情报错的情况
if result["success"]:
# 获取返利明细中demandCode
result = {"demandCode": result["data"][0]["demandCode"]}
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict26", demand_code)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
else:
# 获取预期结果/打印出有问题的需求单信息
check_dict = commonFuc().get_business_data(module, "checkDict26", demand_code)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
......@@ -50,6 +50,7 @@ result = requests.get(url, params=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
# print(result)
result["api_time"] = api_time
if proof_sign:
# 获取预期结果
......
......@@ -34,7 +34,7 @@ random_demand = random.randint(0, len(result["data"]["list"]) - 1)
# 获取需求单信息
demand_id = result["data"]["list"][random_demand]["demandId"]
# demand_id = "40187"
demand_code = result["data"]["list"][random_demand]["demandCode"]
# 第三步解除订单占用
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url37")
......@@ -51,9 +51,17 @@ result = requests.get(url, params=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict37")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# 历史数据会出现需求单详情报错的情况
if result["success"]:
# print(result)
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict37")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
else:
# 获取预期结果/打印出有问题的需求单信息
check_dict = commonFuc().get_business_data(module, "checkDict26", demand_code)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
\ No newline at end of file
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