client: adds ctx manager tests

This commit is contained in:
Mose Müller 2024-12-02 14:18:53 +01:00
parent 18df9e288a
commit 27a832bbd1

View File

@ -149,3 +149,15 @@ def test_tab_completion(pydase_client: pydase.Client) -> None:
"sub_service",
]
)
def test_context_manager(pydase_client: pydase.Client) -> None:
client = pydase.Client(url="ws://localhost:9999")
assert client.proxy.connected
with client:
client.proxy.my_property = 1337.01
assert client.proxy.my_property == 1337.01
assert not client.proxy.connected