diff --git a/tests/components/huawei_lte/test_config_flow.py b/tests/components/huawei_lte/test_config_flow.py index 48a3d287b4..2547aa3f01 100644 --- a/tests/components/huawei_lte/test_config_flow.py +++ b/tests/components/huawei_lte/test_config_flow.py @@ -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="OK", ) - 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]