Skip to content

Commit

Permalink
修复断言bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranxu committed Sep 3, 2022
1 parent 4b1c2a5 commit b49d871
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/core/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,11 @@ def my_assert(self, asserts: List, json_format: bool) -> [str, bool]:
# 判断请求返回是否是json格式,如果不是则不进行loads操作
actually = self.translate(item.actually)
status, err = self.ops(item.assert_type, expected, actually)
if not status:
ok = False
result[item.id] = {"status": status, "msg": err}
except Exception as e:
if ok is True:
ok = False
ok = False
self.append(f"预期结果: {item.expected}\n实际结果: {item.actually}\n")
result[item.id] = {"status": False, "msg": f"断言取值失败, 请检查断言语句: {e}"}
return json.dumps(result, ensure_ascii=False), ok
Expand Down

0 comments on commit b49d871

Please sign in to comment.