Skip to content

Commit fc4aab7

Browse files
author
Andrei Neagu
committed
fixed broken tests
1 parent 346590c commit fc4aab7

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

services/web/server/src/simcore_service_webserver/users/_schemas.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ class UserProfile(OutputSchema):
1919
first_name: str | None
2020
last_name: str | None
2121
email: LowerCaseEmailStr
22-
institution: str | None
22+
institution: str | None = None
2323
phone: str | None
24-
address: str | None
25-
city: str | None
26-
state: str | None = Field(description="State, province, canton, ...")
27-
postal_code: str | None
28-
country: str | None
24+
address: str | None = None
25+
city: str | None = None
26+
state: str | None = Field(None, description="State, province, canton, ...")
27+
postal_code: str | None = None
28+
country: str | None = None
2929
extras: dict[str, Any] = Field(
3030
default_factory=dict,
3131
description="Keeps extra information provided in the request form",
@@ -36,7 +36,7 @@ class UserProfile(OutputSchema):
3636

3737
# user status
3838
registered: bool
39-
status: UserStatus | None
39+
status: UserStatus | None = None
4040
products: list[ProductName] | None = Field(
4141
default=None,
4242
description="List of products this users is included or None if fields is unset",

services/web/server/src/simcore_service_webserver/version_control/_handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ async def _update_checkpoint_annotations_handler(request: web.Request):
238238
path_params = parse_request_path_parameters_as(_CheckpointsPathParam, request)
239239
update = await parse_request_body_as(CheckpointAnnotations, request)
240240

241+
assert isinstance(path_params.ref_id, int)
242+
241243
checkpoint: Checkpoint = await update_checkpoint(
242244
vc_repo,
243245
project_uuid=path_params.project_uuid,

services/web/server/src/simcore_service_webserver/version_control/models.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
from datetime import datetime
2-
from typing import Any, TypeAlias, Union
2+
from typing import Annotated, Any, TypeAlias, Union
33

44
from aiopg.sa.result import RowProxy
55
from models_library.basic_types import SHA1Str
66
from models_library.projects import ProjectID
77
from models_library.projects_nodes import Node
8-
from pydantic import ConfigDict, BaseModel, Field, PositiveInt, StrictBool, StrictFloat, StrictInt
8+
from pydantic import (
9+
BaseModel,
10+
ConfigDict,
11+
Field,
12+
PositiveInt,
13+
StrictBool,
14+
StrictFloat,
15+
StrictInt,
16+
)
917
from pydantic.networks import HttpUrl
1018

1119
BuiltinTypes: TypeAlias = Union[StrictBool, StrictInt, StrictFloat, str]
@@ -24,7 +32,7 @@
2432

2533
CommitID: TypeAlias = int
2634
BranchID: TypeAlias = int
27-
RefID: TypeAlias = CommitID | str
35+
RefID: TypeAlias = Annotated[CommitID | str, Field(union_mode="left_to_right")]
2836

2937
CheckpointID: TypeAlias = PositiveInt
3038

@@ -51,6 +59,7 @@ def from_commit_log(cls, commit: RowProxy, tags: list[RowProxy]) -> "Checkpoint"
5159

5260
class WorkbenchView(BaseModel):
5361
"""A view (i.e. read-only and visual) of the project's workbench"""
62+
5463
model_config = ConfigDict(from_attributes=True)
5564

5665
# NOTE: Tmp replacing UUIDS by str due to a problem serializing to json UUID keys

services/web/server/tests/unit/with_dbs/03/version_control/test_version_control_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ async def test_workflow(
121121
)
122122

123123
assert CheckpointApiModel.model_validate(page.data[0]) == checkpoint1
124-
125124
# UPDATE checkpoint annotations
125+
# here is the issue
126126
resp = await client.patch(
127127
f"/{VX}/repos/projects/{project_uuid}/checkpoints/{checkpoint1.id}",
128128
json={"message": "updated message", "tag": "Version 1"},

0 commit comments

Comments
 (0)