|
@@ -110,7 +110,7 @@ class RequestUtil:
|
|
url = arg_names['request'].pop("url")
|
|
url = arg_names['request'].pop("url")
|
|
# 发送请求
|
|
# 发送请求
|
|
res = self.send_request(name, method, url, **arg_names['request'])
|
|
res = self.send_request(name, method, url, **arg_names['request'])
|
|
- # print(json.loads(json.dumps(res.json()).replace(r"\\", "\\")))
|
|
|
|
|
|
+ print(res.json())
|
|
return_text = res.text
|
|
return_text = res.text
|
|
# print(return_text)
|
|
# print(return_text)
|
|
return_json = ""
|
|
return_json = ""
|
|
@@ -157,9 +157,8 @@ class RequestUtil:
|
|
def assert_result(self, yq_result, sj_result, return_code):
|
|
def assert_result(self, yq_result, sj_result, return_code):
|
|
try:
|
|
try:
|
|
logs("预期结果:%s" % yq_result)
|
|
logs("预期结果:%s" % yq_result)
|
|
- logs("实际结果:%s" % json.loads(json.dumps(sj_result).replace(r"\\", "\\")))
|
|
|
|
-
|
|
|
|
- # print(yq_result)
|
|
|
|
|
|
+ logs("实际结果:%s" % sj_result)
|
|
|
|
+ # logs("实际结果:%s" % json.loads(json.dumps(sj_result).replace(r"\\", "\\")))
|
|
for yq in yq_result:
|
|
for yq in yq_result:
|
|
for key, value in yq.items():
|
|
for key, value in yq.items():
|
|
# print(key, value)
|
|
# print(key, value)
|
|
@@ -167,7 +166,9 @@ class RequestUtil:
|
|
self.assert_equals(value, sj_result, return_code)
|
|
self.assert_equals(value, sj_result, return_code)
|
|
|
|
|
|
elif key == "contains":
|
|
elif key == "contains":
|
|
- self.assert_contains(value, json.loads(json.dumps(sj_result).replace(r"\\", "\\")))
|
|
|
|
|
|
+ # self.assert_contains(value, json.loads(json.dumps(sj_result).replace(r"\\", "\\")))
|
|
|
|
+ self.assert_contains(value, sj_result)
|
|
|
|
+
|
|
|
|
|
|
elif key == 'db_equals':
|
|
elif key == 'db_equals':
|
|
self.database_assert(value, sj_result)
|
|
self.database_assert(value, sj_result)
|