mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-09-27 04:22:46 +02:00
Ensure calling the BLE connection unsubscribe multiple times does not raise
Adds coverage for this case since we have workarounds in HA that we can remove since its now safe
This commit is contained in:
parent
6a51170e0c
commit
fd8471e48b
@ -1821,6 +1821,15 @@ async def test_bluetooth_device_connect(
|
||||
await asyncio.sleep(0)
|
||||
assert states == [(True, 23, 0), (False, 23, 7)]
|
||||
|
||||
# Make sure cancel is safe to call again
|
||||
cancel()
|
||||
|
||||
await client.disconnect(force=True)
|
||||
await asyncio.sleep(0)
|
||||
assert not client._connection
|
||||
# Make sure cancel is safe to call after disconnect
|
||||
cancel()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bluetooth_device_connect_and_disconnect_times_out(
|
||||
|
Loading…
Reference in New Issue
Block a user