Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Nov 5, 2024
1 parent b431138 commit 2989b60
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/websocket/test_websocket_server_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest

from tests.conftest import CombinedWebsocketGateways
from zha.application.gateway import WebSocketServerGateway
from zha.application.gateway import WebSocketClientGateway, WebSocketServerGateway
from zha.application.helpers import ZHAData
from zha.websocket.client.client import Client

Expand Down Expand Up @@ -33,6 +33,13 @@ async def test_server_client_connect_disconnect(
assert "not connected" in repr(client)
assert not client.connected

async with WebSocketClientGateway(zha_data) as client_gateway:
assert client_gateway.client.connected
assert client_gateway.client._listen_task is not None

assert not client_gateway.client.connected
assert client_gateway.client._listen_task is None

assert not gateway.is_serving
assert gateway._ws_server is None

Expand Down

0 comments on commit 2989b60

Please sign in to comment.