mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Use MockConfigEntry.start_reauth_flow in Roborock's tests (#151528)
This commit is contained in:
@@ -230,12 +230,7 @@ async def test_reauth_flow(
|
|||||||
hass: HomeAssistant, bypass_api_fixture, mock_roborock_entry: MockConfigEntry
|
hass: HomeAssistant, bypass_api_fixture, mock_roborock_entry: MockConfigEntry
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test reauth flow."""
|
"""Test reauth flow."""
|
||||||
# Start reauth
|
result = await mock_roborock_entry.start_reauth_flow(hass)
|
||||||
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
|
|
||||||
assert result["step_id"] == "reauth_confirm"
|
assert result["step_id"] == "reauth_confirm"
|
||||||
|
|
||||||
# Request a new code
|
# Request a new code
|
||||||
@@ -311,12 +306,7 @@ async def test_reauth_wrong_account(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Ensure that reauthentication must use the same account."""
|
"""Ensure that reauthentication must use the same account."""
|
||||||
|
|
||||||
# Start reauth
|
result = await mock_roborock_entry.start_reauth_flow(hass)
|
||||||
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
|
|
||||||
assert result["step_id"] == "reauth_confirm"
|
assert result["step_id"] == "reauth_confirm"
|
||||||
|
|
||||||
with patch(
|
with patch(
|
||||||
|
|||||||
Reference in New Issue
Block a user