forked from auracaster/bumble_mirror
add rfcomm disconnect test
This commit is contained in:
@@ -62,7 +62,7 @@ def test_frames():
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
@pytest.mark.asyncio
|
||||
async def test_basic_connection() -> None:
|
||||
async def test_connection_and_disconnection() -> None:
|
||||
devices = test_utils.TwoDevices()
|
||||
await devices.setup_connection()
|
||||
|
||||
@@ -83,6 +83,11 @@ async def test_basic_connection() -> None:
|
||||
dlcs[1].write(b'Lorem ipsum dolor sit amet')
|
||||
assert await queues[0].get() == b'Lorem ipsum dolor sit amet'
|
||||
|
||||
closed = asyncio.Event()
|
||||
dlcs[1].on('close', closed.set)
|
||||
await dlcs[1].disconnect()
|
||||
await closed.wait()
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user