Commit 407d0027 authored by liguangyu06's avatar liguangyu06
Browse files

用例优化

parent 619ba53f
...@@ -36,8 +36,15 @@ request_body = commonFuc().get_business_data(module, "payload5") ...@@ -36,8 +36,15 @@ request_body = commonFuc().get_business_data(module, "payload5")
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content) result = json.loads(result.content)
# print(result) # print(result)
# 获取预期结果 if result["code"] == "3021":
check_dict = commonFuc().get_business_data(module, "checkDict5") # 获取预期结果
# print(check_dict) check_dict = commonFuc().get_business_data(module, "checkDict5")
# 断言实际结果中是否包含预期结果的内容 # print(check_dict)
commonFuc().check_result(check_dict, result) # 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
else:
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict5_1")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
\ No newline at end of file
This diff is collapsed.
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