Add start_reauth helper method to MockConfigEntry (#124767)
* Add start_reauth helper method to MockConfigEntry * Two more
This commit is contained in:
parent
274d98f4d7
commit
14eec2e57a
8 changed files with 41 additions and 70 deletions
|
@ -12,7 +12,7 @@ from requests.exceptions import ConnectTimeout
|
|||
|
||||
from homeassistant.components.abode import config_flow
|
||||
from homeassistant.components.abode.const import CONF_POLLING, DOMAIN
|
||||
from homeassistant.config_entries import SOURCE_REAUTH, SOURCE_USER
|
||||
from homeassistant.config_entries import SOURCE_USER
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
|
@ -161,18 +161,15 @@ async def test_step_reauth(hass: HomeAssistant) -> None:
|
|||
"""Test the reauth flow."""
|
||||
conf = {CONF_USERNAME: "user@email.com", CONF_PASSWORD: "password"}
|
||||
|
||||
MockConfigEntry(
|
||||
entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
unique_id="user@email.com",
|
||||
data=conf,
|
||||
).add_to_hass(hass)
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
with patch("homeassistant.components.abode.config_flow.Abode"):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_REAUTH},
|
||||
data=conf,
|
||||
)
|
||||
result = await entry.start_reauth_flow(hass)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "reauth_confirm"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue