From e1d94374d39f7cd41a4c0f5e43d60f331a396120 Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Thu, 31 Oct 2024 12:08:55 +0100 Subject: [PATCH] fixes fixture --- .../test_api_rest_services_specifications.py | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/services/catalog/tests/unit/with_dbs/test_api_rest_services_specifications.py b/services/catalog/tests/unit/with_dbs/test_api_rest_services_specifications.py index f1bc52a6647..0dbfc8fa3e7 100644 --- a/services/catalog/tests/unit/with_dbs/test_api_rest_services_specifications.py +++ b/services/catalog/tests/unit/with_dbs/test_api_rest_services_specifications.py @@ -27,7 +27,7 @@ from models_library.generated_models.docker_rest_api import ( Resources1 as ServiceTaskResources, ) -from models_library.generated_models.docker_rest_api import ServiceSpec +from models_library.generated_models.docker_rest_api import ServiceSpec, TaskSpec from models_library.products import ProductName from models_library.users import UserID from simcore_postgres_database.models.groups import user_to_groups @@ -91,29 +91,33 @@ def _creator(service_key, service_version, gid) -> ServiceSpecificationsAtDB: service_key=service_key, service_version=service_version, gid=gid, - sidecar=ServiceSpec(Labels=faker.pydict(allowed_types=(str,))), # type: ignore - service=ServiceTaskResources( - Limits=Limit( - NanoCPUs=faker.pyint(), - MemoryBytes=faker.pyint(), - Pids=faker.pyint(), - ), - Reservations=ResourceObject( - NanoCPUs=faker.pyint(), - MemoryBytes=faker.pyint(), - GenericResources=GenericResources( - root=[ - GenericResource( - NamedResourceSpec=NamedResourceSpec( - Kind=faker.pystr(), Value=faker.pystr() - ), - DiscreteResourceSpec=DiscreteResourceSpec( - Kind=faker.pystr(), Value=faker.pyint() - ), - ) - ] - ), - ), + sidecar=ServiceSpec(Labels=faker.pydict(allowed_types=(str,))), + service=ServiceSpec( + TaskTemplate=TaskSpec( + Resources=ServiceTaskResources( + Limits=Limit( + NanoCPUs=faker.pyint(), + MemoryBytes=faker.pyint(), + Pids=faker.pyint(), + ), + Reservations=ResourceObject( + NanoCPUs=faker.pyint(), + MemoryBytes=faker.pyint(), + GenericResources=GenericResources( + root=[ + GenericResource( + NamedResourceSpec=NamedResourceSpec( + Kind=faker.pystr(), Value=faker.pystr() + ), + DiscreteResourceSpec=DiscreteResourceSpec( + Kind=faker.pystr(), Value=faker.pyint() + ), + ) + ] + ), + ), + ) + ) ), )