Skip to content

Commit

Permalink
add rfcomm disconnect test
Browse files Browse the repository at this point in the history
  • Loading branch information
barbibulle committed Jun 5, 2024
1 parent f5baf51 commit e1d10bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/rfcomm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
Expand Down

0 comments on commit e1d10bc

Please sign in to comment.