mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-21 16:50:02 +02:00
adds test for changing task state
This commit is contained in:
parent
d1628ae8c9
commit
7d21bca8b1
@ -405,6 +405,9 @@ def setup_dict() -> dict[str, Any]:
|
||||
enum_attr = MyEnum.RUNNING
|
||||
attr_list = [0, 1, MySubclass()]
|
||||
|
||||
def my_task(self) -> None:
|
||||
pass
|
||||
|
||||
return ServiceClass().serialize()["value"]
|
||||
|
||||
|
||||
@ -439,6 +442,28 @@ def test_update_enum_attribute_to_float(setup_dict: dict[str, Any]) -> None:
|
||||
}
|
||||
|
||||
|
||||
def test_update_task_state(setup_dict: dict[str, Any]) -> None:
|
||||
assert setup_dict["my_task"] == {
|
||||
"async": False,
|
||||
"doc": None,
|
||||
"frontend_render": False,
|
||||
"readonly": True,
|
||||
"signature": {"parameters": {}, "return_annotation": {}},
|
||||
"type": "method",
|
||||
"value": None,
|
||||
}
|
||||
set_nested_value_by_path(setup_dict, "my_task", TaskStatus.RUNNING)
|
||||
assert setup_dict["my_task"] == {
|
||||
"async": False,
|
||||
"doc": None,
|
||||
"frontend_render": False,
|
||||
"readonly": True,
|
||||
"signature": {"parameters": {}, "return_annotation": {}},
|
||||
"type": "method",
|
||||
"value": "RUNNING",
|
||||
}
|
||||
|
||||
|
||||
def test_update_list_entry(setup_dict: dict[str, Any]) -> None:
|
||||
set_nested_value_by_path(setup_dict, "attr_list[1]", 20)
|
||||
assert setup_dict["attr_list"]["value"][1]["value"] == 20
|
||||
|
Loading…
x
Reference in New Issue
Block a user