From c8e9b98a2b1d82f42cca7852a79d6080e1d1b0e6 Mon Sep 17 00:00:00 2001 From: azhengzz <820108271@qq.com> Date: Thu, 11 Mar 2021 20:24:23 +0800 Subject: [PATCH] =?UTF-8?q?LastResult=E4=B8=ADresult=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E4=B8=8A=E6=AC=A1=E6=89=A7=E8=A1=8C=E6=9C=9F?= =?UTF-8?q?=E6=9C=9B=E6=96=AD=E8=A8=80=E7=BB=93=E6=9E=9C=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=9F=E6=9C=9B=E6=96=AD=E8=A8=80=E5=88=99?= =?UTF-8?q?=E4=B8=BATrue=EF=BC=8C=E4=B9=8B=E5=89=8D=E6=98=AFFalse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApiAutomationTest/app/cores/case/base/expectation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApiAutomationTest/app/cores/case/base/expectation.py b/ApiAutomationTest/app/cores/case/base/expectation.py index 4be260d..e6423da 100644 --- a/ApiAutomationTest/app/cores/case/base/expectation.py +++ b/ApiAutomationTest/app/cores/case/base/expectation.py @@ -31,8 +31,8 @@ def get_expectations_result(expectations, request, expectation_logic) -> bool: last_failure_msg = '[期望值: %s] [实际值: 请参考“响应-响应体”中内容]' % expectation.value_ # 解决HTTP响应文本内容包含html片段导致前台解析问题 end expectation.update_assert_result(last_result=last_result, last_failure_msg=last_failure_msg) - if len(rets) == 0: # 未设置期望断言则结果为False - return False + if len(rets) == 0: # 未设置期望断言则结果为True + return True if expectation_logic == EXPECTATION_LOGIC.AND: return all(rets) if expectation_logic == EXPECTATION_LOGIC.OR: