Skip to content

Commit aed5786

Browse files
committed
fix(tests): Fix for windows paths
1 parent 30773c9 commit aed5786

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/env/dev/types/test_linux_container.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,10 +1401,17 @@ def test_directory_to_existing_directory(self, linux_container, test_target_dire
14011401
assert (test_target_directory / "existing_dir" / "folder1" / "file_deep1.txt").exists()
14021402

14031403
def test_directory_to_existing_file_fails(self, linux_container, test_target_directory):
1404+
from dda.utils.platform import PLATFORM_ID
1405+
14041406
existing_file = test_target_directory / "some_file.txt"
14051407
existing_file.write_text("existing content")
14061408

1407-
with pytest.raises(FileExistsError, match=f"File exists: '{existing_file}'"):
1409+
message = (
1410+
f"Cannot create a file when that file already exists: '{str(existing_file).replace('\\', '\\\\')}"
1411+
if PLATFORM_ID == "windows"
1412+
else f"File exists: '{existing_file}'"
1413+
)
1414+
with pytest.raises(FileExistsError, match=message):
14081415
linux_container.export_path(source="/folder1", destination=existing_file)
14091416

14101417

0 commit comments

Comments
 (0)