mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-10 17:43:00 +08:00
fix: ensure_file_path_valid for folder path
This commit is contained in:
@@ -198,7 +198,7 @@ def ensure_file_path_valid(file_path: Text) -> Text:
|
||||
raw_file_relative_name = raw_file_name
|
||||
|
||||
path_names = []
|
||||
for name in raw_file_relative_name.split(os.sep):
|
||||
for name in raw_file_relative_name.rstrip(os.sep).split(os.sep):
|
||||
|
||||
if name[0] in string.digits:
|
||||
# ensure file name not startswith digit
|
||||
|
||||
@@ -126,3 +126,7 @@ class TestUtils(unittest.TestCase):
|
||||
ensure_file_path_valid("1/2B/3.yml"),
|
||||
os.path.join(os.getcwd(), "T1/T2B/T3.yml"),
|
||||
)
|
||||
self.assertEqual(
|
||||
ensure_file_path_valid("examples/postman-echo/request.methods/"),
|
||||
os.path.join(os.getcwd(), "examples/postman_echo/request_methods"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user