Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Neagu committed Nov 1, 2024
1 parent 9401b7b commit 830c88b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
DynamicServiceStart,
)
from models_library.projects import ProjectID
from pydantic import TypeAdapter
from servicelib.deferred_tasks import TaskUID
from simcore_service_dynamic_scheduler.services.service_tracker._models import (
SchedulerServiceState,
Expand Down Expand Up @@ -51,8 +52,8 @@ def test_serialization(
"dynamic_service_start",
[
None,
DynamicServiceStart.parse_obj(
DynamicServiceStart.Config.schema_extra["example"]
TypeAdapter(DynamicServiceStart).validate_python(
DynamicServiceStart.model_config["json_schema_extra"]["example"]
),
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
NodeGetUnknown,
)
from models_library.projects_nodes_io import NodeID
from pydantic import TypeAdapter
from pytest_mock import MockerFixture
from servicelib.rabbitmq import RPCServerError
from simcore_service_webserver.dynamic_scheduler.api import (
Expand Down Expand Up @@ -47,8 +48,10 @@ def mock_rpc_client(

@pytest.fixture
def dynamic_service_start() -> DynamicServiceStart:
return DynamicServiceStart.parse_obj(
DynamicServiceStart.Config.schema_extra["example"]
return (
TypeAdapter(DynamicServiceStart).validate_python(
DynamicServiceStart.model_config["json_schema_extra"]["example"]
),
)


Expand Down

0 comments on commit 830c88b

Please sign in to comment.