Skip to content

Commit 190be9a

Browse files
✨🎨 Remove all http catalog client from api-server and introduce listing of programs endpoint (#7575)
1 parent 85d61c3 commit 190be9a

File tree

20 files changed

+862
-400
lines changed

20 files changed

+862
-400
lines changed

packages/pytest-simcore/src/pytest_simcore/helpers/catalog_rpc_server.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
from pytest_mock import MockType
2828
from servicelib.rabbitmq._client_rpc import RabbitMQRPCClient
2929

30+
assert ServiceListFilters.model_json_schema()["properties"].keys() == {
31+
"service_type"
32+
}, (
33+
"ServiceListFilters is expected to only have the key 'service_type'. "
34+
"Please update the mock if the schema changes."
35+
)
36+
3037

3138
class CatalogRpcSideEffects:
3239
# pylint: disable=no-self-use
@@ -44,11 +51,15 @@ async def list_services_paginated(
4451
assert rpc_client
4552
assert product_name
4653
assert user_id
47-
assert filters is None, "filters not mocked yet"
4854

4955
items = TypeAdapter(list[LatestServiceGet]).validate_python(
5056
LatestServiceGet.model_json_schema()["examples"],
5157
)
58+
if filters:
59+
items = [
60+
item for item in items if item.service_type == filters.service_type
61+
]
62+
5263
total_count = len(items)
5364

5465
return PageRpc[LatestServiceGet].create(

packages/pytest-simcore/src/pytest_simcore/helpers/faker_catalog.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)