mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-06 13:30:41 +02:00
tests: property starting with dependency name
This commit is contained in:
parent
c4e7fe66a8
commit
d015333123
@ -262,3 +262,22 @@ def test_dependency_as_function_argument(caplog: pytest.LogCaptureFixture) -> No
|
||||
service_instance.some_int = 1337
|
||||
|
||||
assert "'other_int' changed to '1338'" in caplog.text
|
||||
|
||||
|
||||
def test_property_starting_with_dependency_name(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
class MyObservable(pydase.DataService):
|
||||
my_int = 0
|
||||
|
||||
@property
|
||||
def my_int_2(self) -> int:
|
||||
return self.my_int + 1
|
||||
|
||||
service_instance = MyObservable()
|
||||
state_manager = StateManager(service=service_instance)
|
||||
DataServiceObserver(state_manager)
|
||||
|
||||
service_instance.my_int = 1337
|
||||
|
||||
assert "'my_int_2' changed to '1338'" in caplog.text
|
||||
|
Loading…
x
Reference in New Issue
Block a user