From ec21585e00491d9523d494ebbeb9f9b07aa1dade Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 5 Jun 2020 16:21:38 +0800 Subject: [PATCH] fix: check if valid v2/v3 format --- httprunner/make.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/httprunner/make.py b/httprunner/make.py index 1099a12e..914aad29 100644 --- a/httprunner/make.py +++ b/httprunner/make.py @@ -421,6 +421,9 @@ def __make(tests_path: Text) -> NoReturn: if "request" in test_content: test_content = ensure_testcase_v3_api(test_content) + if not (isinstance(test_content, Dict) and "config" in test_content): + raise exceptions.FileFormatError("Invalid testcase/testsuite v2/v3 format!") + test_content.setdefault("config", {})["path"] = test_file # testcase