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