This commit is contained in:
jing song 2021-11-15 17:58:18 +08:00
parent 94990cb35a
commit 68e8c20b04
2 changed files with 18 additions and 2 deletions

View File

@ -92,8 +92,8 @@ def assert_text(hope_res, real_res,third_data=None,third_datas=None):
assert str(r_res) == str(h_res["value"])
logging.info("json断言通过, 期望结果'{0}', 实际结果'{1}'".format(h_res, r_res))
elif third_datas:
if h_res["relevance"]:
h_res["value"] = replace_random(str(h_res["value"]), res=third_datas[h_res["relevance"]])
if h_res["relevanceCheck"]:
h_res["value"] = replace_random(str(h_res["value"]), res=third_datas[h_res["relevanceCheck"]])
with allure.step("json断言判断相等"):
allure.attach(name="期望结果", body=str(h_res))
allure.attach(name='实际实际结果', body=str(r_res))

16
scripts/relevance.py Normal file
View File

@ -0,0 +1,16 @@
# coding:utf-8
"""
@author: 井松
@contact: 529548204@qq.com
@file: relevance.py
@time: 2021/11/15 17:13
"""
from cacheout import Cache
class Relevance(object):
def __init__(self):
self.caches = Cache()
# def relevance(self,data):