Skip to content

Commit a0df3cc

Browse files
committed
fixed test
1 parent 30df8dd commit a0df3cc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/models-library/src/models_library/projects_nodes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ class Node(BaseModel):
331331

332332
state: Annotated[
333333
NodeState | None,
334-
Field(description="The node's state object"),
335-
] = None
334+
Field(default_factory=NodeState, description="The node's state object"),
335+
] = DEFAULT_FACTORY
336336

337337
boot_options: Annotated[
338338
dict[EnvVarKey, str] | None,

packages/models-library/tests/test_project_nodes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def test_create_minimal_node(minimal_node_data_sample: dict[str, Any]):
2929
assert node.state.current_status == RunningState.NOT_STARTED
3030
assert node.state.modified is True
3131
assert node.state.dependencies == set()
32+
assert node.state.lock_state is None
3233

3334
assert node.parent is None
3435
assert node.progress is None
@@ -37,7 +38,7 @@ def test_create_minimal_node(minimal_node_data_sample: dict[str, Any]):
3738

3839

3940
def test_create_minimal_node_with_new_data_type(
40-
minimal_node_data_sample: dict[str, Any]
41+
minimal_node_data_sample: dict[str, Any],
4142
):
4243
old_node_data = minimal_node_data_sample
4344
# found some old data with this aspect

0 commit comments

Comments
 (0)