fix: compatibility with file name includes dots and space

This commit is contained in:
debugtalk
2020-05-17 09:53:54 +08:00
parent 66928064b5
commit 5a8af565d8

View File

@@ -39,7 +39,7 @@ def make_testcase(testcase_path: str) -> Union[str, None]:
raw_file_name, _ = os.path.splitext(os.path.basename(testcase_path))
# convert title case, e.g. request_with_variables => RequestWithVariables
name_in_title_case = raw_file_name.title().replace("_", "")
name_in_title_case = raw_file_name.replace(".", " ").title().replace("_", "").replace(" ", "")
testcase_dir = os.path.dirname(testcase_path)
testcase_python_path = os.path.join(testcase_dir, f"{raw_file_name}_test.py")