tweak tests

This commit is contained in:
J. Nick Koston 2023-11-28 07:12:16 -06:00
parent 3b82f3c279
commit 6b01938df6
No known key found for this signature in database
1 changed files with 15 additions and 3 deletions

View File

@ -955,9 +955,13 @@ async def test_bluetooth_pair_connection_drops(
address=1234, connected=False, error=13
)
mock_data_received(protocol, generate_plaintext_packet(response))
message = (
"Peripheral 00:00:00:00:04:D2 changed connection status while waiting"
" for BluetoothDevicePairingResponse: Invalid attribute length"
)
with pytest.raises(
BluetoothConnectionDroppedError,
match="Peripheral changed connection status while waiting for BluetoothDevicePairingResponse: Invalid attribute length",
match=message,
):
await pair_task
@ -976,9 +980,13 @@ async def test_bluetooth_unpair_connection_drops(
address=1234, connected=False, error=13
)
mock_data_received(protocol, generate_plaintext_packet(response))
message = (
"Peripheral 00:00:00:00:04:D2 changed connection status while waiting"
" for BluetoothDeviceUnpairingResponse: Invalid attribute length"
)
with pytest.raises(
BluetoothConnectionDroppedError,
match="Peripheral changed connection status while waiting for BluetoothDeviceUnpairingResponse: Invalid attribute length",
match=message,
):
await pair_task
@ -997,9 +1005,13 @@ async def test_bluetooth_clear_cache_connection_drops(
address=1234, connected=False, error=13
)
mock_data_received(protocol, generate_plaintext_packet(response))
message = (
"Peripheral 00:00:00:00:04:D2 changed connection status while waiting"
" for BluetoothDeviceClearCacheResponse: Invalid attribute length"
)
with pytest.raises(
BluetoothConnectionDroppedError,
match="Peripheral changed connection status while waiting for BluetoothDeviceClearCacheResponse: Invalid attribute length",
match=message,
):
await pair_task