mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-26 12:45:26 +01:00
Add coverage to ensure pairing ignores responses from the wrong device (#748)
This commit is contained in:
parent
98c6e6a2ae
commit
a8e2e6828b
@ -907,6 +907,10 @@ async def test_bluetooth_pair(
|
||||
client, connection, transport, protocol = api_client
|
||||
pair_task = asyncio.create_task(client.bluetooth_device_pair(1234))
|
||||
await asyncio.sleep(0)
|
||||
response: message.Message = BluetoothDevicePairingResponse(address=4567)
|
||||
mock_data_received(protocol, generate_plaintext_packet(response))
|
||||
await asyncio.sleep(0)
|
||||
assert not pair_task.done()
|
||||
response: message.Message = BluetoothDevicePairingResponse(address=1234)
|
||||
mock_data_received(protocol, generate_plaintext_packet(response))
|
||||
await pair_task
|
||||
|
Loading…
Reference in New Issue
Block a user