mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +08:00
fix: compatibility with testcase file path includes minus sign
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
**Fixed**
|
**Fixed**
|
||||||
|
|
||||||
- fix: compatibility with testcase file path includes dots and space
|
- fix: compatibility with testcase file path includes dots, space and minus sign
|
||||||
- fix: testcase generator, validate content.xxx => body.xxx
|
- fix: testcase generator, validate content.xxx => body.xxx
|
||||||
- fix: scaffold for v3
|
- fix: scaffold for v3
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ def convert_testcase_path(testcase_path: Text) -> Tuple[Text, Text]:
|
|||||||
if file_suffix not in [".json", ".yml", ".yaml"]:
|
if file_suffix not in [".json", ".yml", ".yaml"]:
|
||||||
raise exceptions.ParamsError("")
|
raise exceptions.ParamsError("")
|
||||||
|
|
||||||
file_name = raw_file_name.replace(" ", "_").replace(".", "_")
|
file_name = raw_file_name.replace(" ", "_").replace(".", "_").replace("-", "_")
|
||||||
testcase_dir = os.path.dirname(testcase_path)
|
testcase_dir = os.path.dirname(testcase_path)
|
||||||
testcase_python_path = os.path.join(testcase_dir, f"{file_name}_test.py")
|
testcase_python_path = os.path.join(testcase_dir, f"{file_name}_test.py")
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,6 @@ class TestLoader(unittest.TestCase):
|
|||||||
convert_testcase_path("mubu.login.yml")[0],
|
convert_testcase_path("mubu.login.yml")[0],
|
||||||
"mubu_login_test.py"
|
"mubu_login_test.py"
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
|
||||||
convert_testcase_path("mubu login.yml")[0],
|
|
||||||
"mubu_login_test.py"
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
convert_testcase_path("/path/to/mubu.login.yml")[0],
|
convert_testcase_path("/path/to/mubu.login.yml")[0],
|
||||||
"/path/to/mubu_login_test.py"
|
"/path/to/mubu_login_test.py"
|
||||||
@@ -40,7 +36,27 @@ class TestLoader(unittest.TestCase):
|
|||||||
convert_testcase_path("/path/to 2/mubu.login.yml")[1],
|
convert_testcase_path("/path/to 2/mubu.login.yml")[1],
|
||||||
"MubuLogin"
|
"MubuLogin"
|
||||||
)
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
convert_testcase_path("mubu login.yml")[0],
|
||||||
|
"mubu_login_test.py"
|
||||||
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
convert_testcase_path("/path/to 2/mubu login.yml")[1],
|
convert_testcase_path("/path/to 2/mubu login.yml")[1],
|
||||||
"MubuLogin"
|
"MubuLogin"
|
||||||
)
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
convert_testcase_path("/path/to 2/mubu-login.yml")[0],
|
||||||
|
"/path/to 2/mubu_login_test.py"
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
convert_testcase_path("/path/to 2/mubu-login.yml")[1],
|
||||||
|
"MubuLogin"
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
convert_testcase_path("/path/to 2/幕布login.yml")[0],
|
||||||
|
"/path/to 2/幕布login_test.py"
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
convert_testcase_path("/path/to/幕布login.yml")[1],
|
||||||
|
"幕布Login"
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user