mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Fix flaky huawei test (#41204)
This commit is contained in:
parent
e97792adf0
commit
e2921475e2
@ -17,6 +17,7 @@ from homeassistant.const import (
|
|||||||
CONF_USERNAME,
|
CONF_USERNAME,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from tests.async_mock import patch
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
FIXTURE_USER_INPUT = {
|
FIXTURE_USER_INPUT = {
|
||||||
@ -140,9 +141,15 @@ async def test_success(hass, login_requests_mock):
|
|||||||
f"{FIXTURE_USER_INPUT[CONF_URL]}api/user/login",
|
f"{FIXTURE_USER_INPUT[CONF_URL]}api/user/login",
|
||||||
text="<response>OK</response>",
|
text="<response>OK</response>",
|
||||||
)
|
)
|
||||||
result = await hass.config_entries.flow.async_init(
|
with patch("homeassistant.components.huawei_lte.async_setup"), patch(
|
||||||
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=FIXTURE_USER_INPUT
|
"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["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||||
assert result["data"][CONF_URL] == FIXTURE_USER_INPUT[CONF_URL]
|
assert result["data"][CONF_URL] == FIXTURE_USER_INPUT[CONF_URL]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user