Add coverage for client api_version being None after disconnected (#747)

This commit is contained in:
J. Nick Koston 2023-11-26 17:14:41 -06:00 committed by GitHub
parent 3ff5f876d5
commit 98c6e6a2ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -1868,3 +1868,16 @@ async def test_subscribe_voice_assistant_failure(
# and does not raise
unsub()
assert len(send.mock_calls) == 0
@pytest.mark.asyncio
async def test_api_version_after_connection_closed(
api_client: tuple[
APIClient, APIConnection, asyncio.Transport, APIPlaintextFrameHelper
],
) -> None:
"""Test api version is None after connection close."""
client, connection, transport, protocol = api_client
assert client.api_version == APIVersion(1, 9)
await client.disconnect(force=True)
assert client.api_version is None