Skip to content

Commit 765d22c

Browse files
committed
chore: add more tests for already connected devices
1 parent 2c9323a commit 765d22c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/devices/test_device_manager.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,14 @@ async def test_ready_callback(home_data: HomeData) -> None:
182182
device = ready_devices[0]
183183
assert device.duid == "abc123"
184184

185+
# Verify that adding a ready callback to an already connected device will
186+
# invoke the callback immediately.
187+
more_ready_device: list[RoborockDevice] = []
188+
device.add_ready_callback(more_ready_device.append)
189+
assert len(more_ready_device) == 1
190+
assert more_ready_device[0].duid == "abc123"
191+
192+
185193
await device_manager.close()
186194

187195

0 commit comments

Comments
 (0)