Skip to content

Commit 2d5f228

Browse files
authored
Use MockConfigEntry.start_reauth_flow in Roborock's tests (home-assistant#151528)
1 parent 19f36fc commit 2d5f228

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

tests/components/roborock/test_config_flow.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,7 @@ async def test_reauth_flow(
230230
hass: HomeAssistant, bypass_api_fixture, mock_roborock_entry: MockConfigEntry
231231
) -> None:
232232
"""Test reauth flow."""
233-
# Start reauth
234-
result = mock_roborock_entry.async_start_reauth(hass)
235-
await hass.async_block_till_done()
236-
flows = hass.config_entries.flow.async_progress()
237-
assert len(flows) == 1
238-
[result] = flows
233+
result = await mock_roborock_entry.start_reauth_flow(hass)
239234
assert result["step_id"] == "reauth_confirm"
240235

241236
# Request a new code
@@ -311,12 +306,7 @@ async def test_reauth_wrong_account(
311306
) -> None:
312307
"""Ensure that reauthentication must use the same account."""
313308

314-
# Start reauth
315-
result = mock_roborock_entry.async_start_reauth(hass)
316-
await hass.async_block_till_done()
317-
flows = hass.config_entries.flow.async_progress()
318-
assert len(flows) == 1
319-
[result] = flows
309+
result = await mock_roborock_entry.start_reauth_flow(hass)
320310
assert result["step_id"] == "reauth_confirm"
321311

322312
with patch(

0 commit comments

Comments
 (0)