Fix flaky huawei test (#41204)
This commit is contained in:
parent
e97792adf0
commit
e2921475e2
1 changed files with 10 additions and 3 deletions
|
@ -17,6 +17,7 @@ from homeassistant.const import (
|
|||
CONF_USERNAME,
|
||||
)
|
||||
|
||||
from tests.async_mock import patch
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
FIXTURE_USER_INPUT = {
|
||||
|
@ -140,9 +141,15 @@ async def test_success(hass, login_requests_mock):
|
|||
f"{FIXTURE_USER_INPUT[CONF_URL]}api/user/login",
|
||||
text="<response>OK</response>",
|
||||
)
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=FIXTURE_USER_INPUT
|
||||
)
|
||||
with patch("homeassistant.components.huawei_lte.async_setup"), patch(
|
||||
"homeassistant.components.huawei_lte.async_setup_entry"
|
||||
):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_USER},
|
||||
data=FIXTURE_USER_INPUT,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result["data"][CONF_URL] == FIXTURE_USER_INPUT[CONF_URL]
|
||||
|
|
Loading…
Add table
Reference in a new issue