Commit 14393cb9 authored by liguangyu06's avatar liguangyu06
Browse files

增加响应时间获取

parent ab0227b6
...@@ -37,6 +37,8 @@ request_body = commonFuc().get_business_data(module, "payload2", demand_id) ...@@ -37,6 +37,8 @@ request_body = commonFuc().get_business_data(module, "payload2", demand_id)
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = result.elapsed.total_seconds()
result = json.loads(result.content) result = json.loads(result.content)
# print(result) # print(result)
# 获取预期结果 # 获取预期结果
......
...@@ -44,6 +44,8 @@ request_body = commonFuc().get_business_data(module, "payload4", demand_id) ...@@ -44,6 +44,8 @@ request_body = commonFuc().get_business_data(module, "payload4", demand_id)
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = result.elapsed.total_seconds()
result = json.loads(result.content) result = json.loads(result.content)
# print(result) # print(result)
# 获取预期结果 # 获取预期结果
......
...@@ -73,6 +73,8 @@ request_body3 = commonFuc().get_business_data(module, "payload3", demand_id) ...@@ -73,6 +73,8 @@ request_body3 = commonFuc().get_business_data(module, "payload3", demand_id)
# 发送请求 # 发送请求
result3 = requests.post(url3, json=request_body3, headers=headers) result3 = requests.post(url3, json=request_body3, headers=headers)
# 获取接口响应时间
api_time = result3.elapsed.total_seconds()
result3 = json.loads(result3.content) result3 = json.loads(result3.content)
# print(result) # print(result)
# 获取预期结果 # 获取预期结果
......
...@@ -66,6 +66,8 @@ if result["code"] == "200": ...@@ -66,6 +66,8 @@ if result["code"] == "200":
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = result.elapsed.total_seconds()
result = json.loads(result.content) result = json.loads(result.content)
# print(result) # print(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