Skip to content

Commit e5fdc18

Browse files
committed
Add test for already in progress
1 parent f2bcfe8 commit e5fdc18

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_tado.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,3 +624,13 @@ async def test_async_init_with_refresh_token() -> None:
624624
assert tado.device_activation_status == DeviceActivationStatus.NOT_STARTED
625625
await tado.async_init()
626626
assert tado.device_activation_status == DeviceActivationStatus.COMPLETED
627+
628+
629+
async def test_login_device_flow_already_in_progress() -> None:
630+
"""Ensure calling login_device_flow again raises TadoError."""
631+
tado = Tado()
632+
tado._device_activation_status = DeviceActivationStatus.PENDING
633+
with pytest.raises(
634+
TadoError, match="Device activation already in progress or completed"
635+
):
636+
await tado.login_device_flow()

0 commit comments

Comments
 (0)