1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-20 02:48:57 +00:00

Use MockConfigEntry.start_reauth_flow in Roborock's tests (#151528)

This commit is contained in:
Abílio Costa
2025-09-01 20:28:42 +01:00
committed by GitHub
parent 19f36fc630
commit 2d5f228308

View File

@@ -230,12 +230,7 @@ async def test_reauth_flow(
hass: HomeAssistant, bypass_api_fixture, mock_roborock_entry: MockConfigEntry
) -> None:
"""Test reauth flow."""
# Start reauth
result = mock_roborock_entry.async_start_reauth(hass)
await hass.async_block_till_done()
flows = hass.config_entries.flow.async_progress()
assert len(flows) == 1
[result] = flows
result = await mock_roborock_entry.start_reauth_flow(hass)
assert result["step_id"] == "reauth_confirm"
# Request a new code
@@ -311,12 +306,7 @@ async def test_reauth_wrong_account(
) -> None:
"""Ensure that reauthentication must use the same account."""
# Start reauth
result = mock_roborock_entry.async_start_reauth(hass)
await hass.async_block_till_done()
flows = hass.config_entries.flow.async_progress()
assert len(flows) == 1
[result] = flows
result = await mock_roborock_entry.start_reauth_flow(hass)
assert result["step_id"] == "reauth_confirm"
with patch(