mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-10 17:43:00 +08:00
fix: avoid '.csv' been converted to '_csv'
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
# Release History
|
||||
|
||||
## 3.0.13 (2020-06-15)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- fix: avoid '.csv' been converted to '_csv'
|
||||
|
||||
## 3.0.12 (2020-06-14)
|
||||
|
||||
**Fixed**
|
||||
|
||||
@@ -210,8 +210,12 @@ def ensure_file_path_valid(file_path: Text) -> Text:
|
||||
# 19 => T19, 2C => T2C
|
||||
name = f"T{name}"
|
||||
|
||||
# handle cases when directory name includes dot/hyphen/space
|
||||
name = name.replace(" ", "_").replace(".", "_").replace("-", "_")
|
||||
if name.startswith("."):
|
||||
# avoid ".csv" been converted to "_csv"
|
||||
pass
|
||||
else:
|
||||
# handle cases when directory name includes dot/hyphen/space
|
||||
name = name.replace(" ", "_").replace(".", "_").replace("-", "_")
|
||||
|
||||
path_names.append(name)
|
||||
|
||||
|
||||
@@ -130,7 +130,8 @@ class TestUtils(unittest.TestCase):
|
||||
ensure_file_path_valid(os.getcwd()), os.getcwd(),
|
||||
)
|
||||
self.assertEqual(
|
||||
ensure_file_path_valid(os.getcwd() + ".csv"), os.getcwd() + ".csv",
|
||||
ensure_file_path_valid(os.path.join(os.getcwd(), "demo", ".csv")),
|
||||
os.path.join(os.getcwd(), "demo", ".csv"),
|
||||
)
|
||||
|
||||
def test_safe_dump_json(self):
|
||||
|
||||
Reference in New Issue
Block a user