def step_impl(context):
"""
:type context behave.runner.Context
"""
_json_data = json_load_file(os.path.join(script_location, "../data/bad_json.json"))
try:
context.schema_tools.apply(_json_data)
except Exception as e:
if str(e)[:32] == "'canRead' is a required property":
ok_(True)
else:
if hasattr(sys, "last_traceback"):
_traceback = traceback.print_tb(sys.last_traceback)
else:
_traceback = "Not available"
ok_(False, "Error: " + str(e) + "\nTraceback:" + _traceback)
评论列表
文章目录