client: adds X-Client-Id header to pydase.Client

This commit is contained in:
Mose Müller
2025-02-20 17:17:19 +01:00
parent 9424d4c412
commit c5e1a08c54
2 changed files with 18 additions and 1 deletions

View File

@ -161,3 +161,15 @@ def test_context_manager(pydase_client: pydase.Client) -> None:
assert client.proxy.my_property == 1337.01
assert not client.proxy.connected
def test_client_id(
pydase_client: pydase.Client, caplog: pytest.LogCaptureFixture
) -> None:
pydase.Client(url="ws://localhost:9999")
assert "Client [id=pydase_client] connected" in caplog.text
caplog.clear()
pydase.Client(url="ws://localhost:9999", client_id="my_service")
assert "Client [id=my_service] connected" in caplog.text