mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-21 00:40:01 +02:00
adds cache test for task status update
This commit is contained in:
parent
a83e0c6c7f
commit
ebb8b4be8b
@ -23,3 +23,20 @@ def test_nested_attributes_cache_callback() -> None:
|
|||||||
|
|
||||||
test_service.class_attr.name = "Ciao"
|
test_service.class_attr.name = "Ciao"
|
||||||
assert get_nested_dict_by_path(cache.cache, "class_attr.name")["value"] == "Ciao"
|
assert get_nested_dict_by_path(cache.cache, "class_attr.name")["value"] == "Ciao"
|
||||||
|
|
||||||
|
|
||||||
|
def test_task_status_update() -> None:
|
||||||
|
class ServiceClass(pydase.DataService):
|
||||||
|
name = "World"
|
||||||
|
|
||||||
|
async def my_method(self) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
test_service = ServiceClass()
|
||||||
|
cache = DataServiceCache(test_service)
|
||||||
|
assert get_nested_dict_by_path(cache.cache, "my_method")["type"] == "method"
|
||||||
|
assert get_nested_dict_by_path(cache.cache, "my_method")["value"] is None
|
||||||
|
|
||||||
|
test_service.start_my_method() # type: ignore
|
||||||
|
assert get_nested_dict_by_path(cache.cache, "my_method")["type"] == "method"
|
||||||
|
assert get_nested_dict_by_path(cache.cache, "my_method")["value"] == {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user