Skip to content

Commit b13d214

Browse files
committed
Convert to posix path at point of write
1 parent d7cb44a commit b13d214

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

wiremock/testing/testcontainer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import tempfile
55
import time
66
from contextlib import contextmanager
7-
from pathlib import Path, PurePosixPath
7+
from pathlib import Path
88
from typing import Any, Dict, Generator, List, Optional, Tuple, Union
99
from urllib.parse import urljoin
1010

@@ -94,7 +94,7 @@ def with_command(self, cmd: Optional[str] = None) -> "WireMockContainer":
9494
def copy_file_to_container(self, host_path: Path, container_path: Path) -> None:
9595
with open(host_path, "rb") as fp:
9696
self.get_wrapped_container().put_archive(
97-
path=container_path, data=fp.read()
97+
path=container_path.as_posix(), data=fp.read()
9898
)
9999

100100
def copy_files_to_container(
@@ -131,7 +131,7 @@ def copy_mappings_to_container(self) -> None:
131131
"""
132132

133133
self.copy_files_to_container(
134-
configs=self.mapping_stubs, container_dir_path=PurePosixPath(f"{self.MAPPINGS_DIR}")
134+
configs=self.mapping_stubs, container_dir_path=Path(f"{self.MAPPINGS_DIR}")
135135
)
136136

137137
def copy_mapping_files_to_container(self) -> None:
@@ -140,7 +140,7 @@ def copy_mapping_files_to_container(self) -> None:
140140
the configured FILES_DIR
141141
"""
142142
self.copy_files_to_container(
143-
configs=self.mapping_files, container_dir_path=PurePosixPath(f"{self.FILES_DIR}")
143+
configs=self.mapping_files, container_dir_path=Path(f"{self.FILES_DIR}")
144144
)
145145

146146
def server_running(self, retry_count: int = 3, retry_delay: int = 1) -> bool:

0 commit comments

Comments
 (0)