Quellcode durchsuchen

fix: path error on windows

trgiangdo vor 1 Jahr
Ursprung
Commit
301986716f

+ 1 - 1
tests/core/data/test_csv_data_node.py

@@ -104,7 +104,7 @@ class TestCSVDataNode:
     )
     def test_create_with_default_data(self, properties, exists):
         dn = CSVDataNode("foo", Scope.SCENARIO, DataNodeId(f"dn_id_{uuid.uuid4()}"), properties=properties)
-        assert dn.path == Config.core.storage_folder + "csvs/" + dn.id + ".csv"
+        assert dn.path == os.path.join(Config.core.storage_folder, "csvs", dn.id + ".csv")
         assert os.path.exists(dn.path) is exists
 
     def test_set_path(self):

+ 1 - 1
tests/core/data/test_excel_data_node.py

@@ -139,7 +139,7 @@ class TestExcelDataNode:
     )
     def test_create_with_default_data(self, properties, exists):
         dn = ExcelDataNode("foo", Scope.SCENARIO, DataNodeId(f"dn_id_{uuid.uuid4()}"), properties=properties)
-        assert dn.path == Config.core.storage_folder + "excels/" + dn.id + ".xlsx"
+        assert dn.path == os.path.join(Config.core.storage_folder, "excels", dn.id + ".xlsx")
         assert os.path.exists(dn.path) is exists
 
     def test_read_write_after_modify_path(self):

+ 1 - 1
tests/core/data/test_json_data_node.py

@@ -315,7 +315,7 @@ class TestJSONDataNode:
     )
     def test_create_with_default_data(self, properties, exists):
         dn = JSONDataNode("foo", Scope.SCENARIO, DataNodeId(f"dn_id_{uuid.uuid4()}"), properties=properties)
-        assert dn.path == Config.core.storage_folder + "jsons/" + dn.id + ".json"
+        assert dn.path == os.path.join(Config.core.storage_folder, "jsons", dn.id + ".json")
         assert os.path.exists(dn.path) is exists
 
     def test_set_path(self):

+ 1 - 1
tests/core/data/test_parquet_data_node.py

@@ -129,7 +129,7 @@ class TestParquetDataNode:
     )
     def test_create_with_default_data(self, properties, exists):
         dn = ParquetDataNode("foo", Scope.SCENARIO, DataNodeId(f"dn_id_{uuid.uuid4()}"), properties=properties)
-        assert dn.path == Config.core.storage_folder + "parquets/" + dn.id + ".parquet"
+        assert dn.path == os.path.join(Config.core.storage_folder, "parquets", dn.id + ".parquet")
         assert os.path.exists(dn.path) is exists
 
     @pytest.mark.parametrize("engine", __engine)