Skip to content

Commit 1b9a8df

Browse files
committed
missing registry configuration
1 parent 866eb7c commit 1b9a8df

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

services/director/tests/unit/api/test_rest_service_extras.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
import httpx
99
from fastapi import status
1010
from fixtures.fake_services import ServiceInRegistryInfoDict
11+
from pytest_simcore.helpers.typing_env import EnvVarsDict
1112

1213

1314
def _assert_response_and_unwrap_envelope(got: httpx.Response):
14-
assert got.encoding == "application/json"
15+
assert got.headers["content-type"] == "application/json"
16+
assert got.encoding == "utf-8"
1517

1618
body = got.json()
1719
assert isinstance(body, dict)
@@ -20,12 +22,14 @@ def _assert_response_and_unwrap_envelope(got: httpx.Response):
2022

2123

2224
async def test_get_services_extras_by_key_and_version_with_empty_registry(
23-
client: httpx.AsyncClient, api_version_prefix: str
25+
configure_registry_access: EnvVarsDict,
26+
client: httpx.AsyncClient,
27+
api_version_prefix: str,
2428
):
2529
resp = await client.get(
2630
f"/{api_version_prefix}/service_extras/whatever/someversion"
2731
)
28-
assert resp.status_code == status.HTTP_400_BAD_REQUEST, f"Got f{resp.text}"
32+
assert resp.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY, f"Got f{resp.text}"
2933
resp = await client.get(
3034
f"/{api_version_prefix}/service_extras/simcore/services/dynamic/something/someversion"
3135
)
@@ -37,6 +41,7 @@ async def test_get_services_extras_by_key_and_version_with_empty_registry(
3741

3842

3943
async def test_get_services_extras_by_key_and_version(
44+
configure_registry_access: EnvVarsDict,
4045
client: httpx.AsyncClient,
4146
created_services: list[ServiceInRegistryInfoDict],
4247
api_version_prefix: str,
@@ -54,6 +59,6 @@ async def test_get_services_extras_by_key_and_version(
5459

5560
assert resp.status_code == status.HTTP_200_OK, f"Got {resp.text=}"
5661

57-
service_extras, error = _assert_response_and_unwrap_envelope(resp.json())
62+
service_extras, error = _assert_response_and_unwrap_envelope(resp)
5863
assert not error
5964
assert created_service["service_extras"] == service_extras

0 commit comments

Comments
 (0)