Skip to content

Commit f56825a

Browse files
committed
fix tests
1 parent 30d0173 commit f56825a

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

packages/pytest-simcore/src/pytest_simcore/pydantic_models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,14 @@ def test_model_examples(
7070
def _is_model_cls(obj) -> bool:
7171
with suppress(TypeError):
7272
# NOTE: issubclass( dict[models_library.services.ConstrainedStrValue, models_library.services.ServiceInput] ) raises TypeError
73+
is_parametrized = False
74+
if hasattr(obj, "__parameters__"):
75+
is_parametrized = len(obj.__parameters__) == 0
7376
return (
7477
obj is not BaseModel
7578
and inspect.isclass(obj)
7679
and issubclass(obj, BaseModel)
80+
and not is_parametrized
7781
)
7882
return False
7983

services/api-server/src/simcore_service_api_server/models/schemas/studies.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Annotated, TypeAlias
22

33
from models_library import projects, projects_nodes_io
4-
from pydantic import AnyUrl, BaseModel, Field, StringConstraints
4+
from pydantic import AnyUrl, BaseModel, ConfigDict, Field, StringConstraints
55

66
from .. import api_resources
77
from . import solvers
@@ -28,6 +28,22 @@ class StudyPort(solvers.SolverPort):
2828
"Correponds to the UUID of the parameter/probe node in the study",
2929
title="Key name",
3030
)
31+
model_config = ConfigDict(
32+
extra="ignore",
33+
json_schema_extra={
34+
"example": {
35+
"key": "f763658f-a89a-4a90-ace4-c44631290f12",
36+
"kind": "input",
37+
"content_schema": {
38+
"title": "Sleep interval",
39+
"type": "integer",
40+
"x_unit": "second",
41+
"minimum": 0,
42+
"maximum": 5,
43+
},
44+
}
45+
},
46+
)
3147

3248

3349
class LogLink(BaseModel):

services/api-server/tests/mocks/get_solver_outputs.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"thumbnail": "https://via.placeholder.com/170x120.png",
3737
"creationDate": "2024-01-18T12:33:56.952Z",
3838
"lastChangeDate": "2024-01-18T12:34:13.002Z",
39+
"workspaceId": 2,
40+
"folderId": 2,
41+
"trashedAt": null,
3942
"workbench": {
4043
"df42d273-b6f0-509c-bfb5-4abbc5bb0581": {
4144
"key": "simcore/services/comp/itis/sleeper",

services/api-server/tests/mocks/get_solver_pricing_plan_success.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@
5757
{
5858
"pricingUnitId": 1,
5959
"unitName": "small",
60-
"unitExtraInfo": {},
60+
"unitExtraInfo": {
61+
"CPU": 2,
62+
"RAM": 1239876234,
63+
"VRAM": 23454676789
64+
},
6165
"currentCostPerUnit": 50,
6266
"default": true
6367
}

0 commit comments

Comments
 (0)