Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tests/auth/test_device_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,15 @@ async def test_authenticate_poll_error(self):
mock_poll.side_effect = DeviceFlowError("Polling failed")

with patch("openhands_cli.auth.device_flow.console_print"):
with pytest.raises(DeviceFlowError, match="Polling failed"):
await client.authenticate()
with patch(
"openhands_cli.auth.device_flow.webbrowser.open"
) as mock_open:
with pytest.raises(DeviceFlowError, match="Polling failed"):
await client.authenticate()

mock_open.assert_called_once_with(
"https://example.com/device?user_code=USER123"
)


@pytest.mark.asyncio
Expand Down