File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
dynamic-scheduler/tests/unit/service_tracker
web/server/tests/unit/isolated Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1212 DynamicServiceStart ,
1313)
1414from models_library .projects import ProjectID
15+ from pydantic import TypeAdapter
1516from servicelib .deferred_tasks import TaskUID
1617from simcore_service_dynamic_scheduler .services .service_tracker ._models import (
1718 SchedulerServiceState ,
@@ -51,8 +52,8 @@ def test_serialization(
5152 "dynamic_service_start" ,
5253 [
5354 None ,
54- DynamicServiceStart . parse_obj (
55- DynamicServiceStart .Config . schema_extra ["example" ]
55+ TypeAdapter ( DynamicServiceStart ). validate_python (
56+ DynamicServiceStart .model_config [ "json_schema_extra" ] ["example" ]
5657 ),
5758 ],
5859)
Original file line number Diff line number Diff line change 1515 NodeGetUnknown ,
1616)
1717from models_library .projects_nodes_io import NodeID
18+ from pydantic import TypeAdapter
1819from pytest_mock import MockerFixture
1920from servicelib .rabbitmq import RPCServerError
2021from simcore_service_webserver .dynamic_scheduler .api import (
@@ -47,8 +48,10 @@ def mock_rpc_client(
4748
4849@pytest .fixture
4950def dynamic_service_start () -> DynamicServiceStart :
50- return DynamicServiceStart .parse_obj (
51- DynamicServiceStart .Config .schema_extra ["example" ]
51+ return (
52+ TypeAdapter (DynamicServiceStart ).validate_python (
53+ DynamicServiceStart .model_config ["json_schema_extra" ]["example" ]
54+ ),
5255 )
5356
5457
You can’t perform that action at this time.
0 commit comments