Skip to content

Commit 17798cc

Browse files
author
Andrei Neagu
committed
fixed broken tests
1 parent ffb95f1 commit 17798cc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

services/dynamic-sidecar/tests/integration/test_modules_long_running_tasks.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,24 @@ async def simcore_storage_service(mocker: MockerFixture, app: FastAPI) -> None:
162162
storage_host: Final[str] | None = os.environ.get("STORAGE_HOST")
163163
storage_port: Final[str] | None = os.environ.get("STORAGE_PORT")
164164

165-
def correct_ip(url: AnyUrl):
166-
165+
def _replace_storage_endpoint(url: str) -> str:
166+
url_obj = TypeAdapter(AnyUrl).validate_python(url)
167167
assert storage_host is not None
168168
assert storage_port is not None
169169

170-
return AnyUrl.build(
171-
scheme=url.scheme,
170+
storage_endpoint_url = AnyUrl.build(
171+
scheme=url_obj.scheme,
172172
host=storage_host,
173-
port=storage_port,
174-
path=url.path,
175-
query=url.query,
173+
port=int(storage_port),
174+
path=url_obj.path.lstrip("/"),
175+
query=url_obj.query,
176176
)
177+
return f"{storage_endpoint_url}"
177178

178179
# NOTE: Mock to ensure container IP agrees with host IP when testing
179180
mocker.patch(
180181
"simcore_sdk.node_ports_common._filemanager._get_https_link_if_storage_secure",
181-
correct_ip,
182+
_replace_storage_endpoint,
182183
)
183184

184185

0 commit comments

Comments
 (0)