mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-09 01:39:39 +08:00
change: ensure testcase file exists
This commit is contained in:
@@ -76,6 +76,9 @@ def __ensure_absolute(path: Text) -> Text:
|
|||||||
else:
|
else:
|
||||||
absolute_path = os.path.join(project_meta.PWD, path)
|
absolute_path = os.path.join(project_meta.PWD, path)
|
||||||
|
|
||||||
|
if not os.path.isfile(absolute_path):
|
||||||
|
raise exceptions.ParamsError(f"Invalid testcase file path: {absolute_path}")
|
||||||
|
|
||||||
return absolute_path
|
return absolute_path
|
||||||
|
|
||||||
|
|
||||||
@@ -107,9 +110,6 @@ def __ensure_testcase_module(path: Text) -> NoReturn:
|
|||||||
|
|
||||||
def convert_testcase_path(testcase_path: Text) -> Tuple[Text, Text]:
|
def convert_testcase_path(testcase_path: Text) -> Tuple[Text, Text]:
|
||||||
"""convert single YAML/JSON testcase path to python file"""
|
"""convert single YAML/JSON testcase path to python file"""
|
||||||
if not os.path.isfile(testcase_path):
|
|
||||||
raise exceptions.ParamsError(f"Invalid testcase file path: {testcase_path}")
|
|
||||||
|
|
||||||
testcase_path = __ensure_file_name(testcase_path)
|
testcase_path = __ensure_file_name(testcase_path)
|
||||||
raw_file_name, file_suffix = os.path.splitext(os.path.basename(testcase_path))
|
raw_file_name, file_suffix = os.path.splitext(os.path.basename(testcase_path))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user