mirror of
https://github.com/elisspace/core.git
synced 2026-10-01 14:59:53 +00:00
Try to load integration before starting option flow (#90111)
* Try to load integration before starting option flow * Adjust tests
This commit is contained in:
@@ -793,6 +793,8 @@ async def test_options_flow(hass: HomeAssistant, client) -> None:
|
||||
|
||||
return OptionsFlowHandler()
|
||||
|
||||
mock_integration(hass, MockModule("test"))
|
||||
mock_entity_platform(hass, "config_flow.test", None)
|
||||
MockConfigEntry(
|
||||
domain="test",
|
||||
entry_id="test1",
|
||||
@@ -824,6 +826,7 @@ async def test_two_step_options_flow(hass: HomeAssistant, client) -> None:
|
||||
mock_integration(
|
||||
hass, MockModule("test", async_setup_entry=AsyncMock(return_value=True))
|
||||
)
|
||||
mock_entity_platform(hass, "config_flow.test", None)
|
||||
|
||||
class TestFlow(core_ce.ConfigFlow):
|
||||
@staticmethod
|
||||
@@ -889,6 +892,7 @@ async def test_options_flow_with_invalid_data(hass: HomeAssistant, client) -> No
|
||||
mock_integration(
|
||||
hass, MockModule("test", async_setup_entry=AsyncMock(return_value=True))
|
||||
)
|
||||
mock_entity_platform(hass, "config_flow.test", None)
|
||||
|
||||
class TestFlow(core_ce.ConfigFlow):
|
||||
@staticmethod
|
||||
|
||||
@@ -11,6 +11,7 @@ from homeassistant.components.zha.core.const import (
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import MockConfigEntry, MockModule, mock_integration
|
||||
|
||||
@@ -159,6 +160,7 @@ async def test_option_flow_install_multi_pan_addon(
|
||||
start_addon,
|
||||
) -> None:
|
||||
"""Test installing the multi pan addon."""
|
||||
assert await async_setup_component(hass, "usb", {})
|
||||
mock_integration(hass, MockModule("hassio"))
|
||||
|
||||
# Setup the config entry
|
||||
@@ -253,6 +255,7 @@ async def test_option_flow_install_multi_pan_addon_zha(
|
||||
start_addon,
|
||||
) -> None:
|
||||
"""Test installing the multi pan addon when a zha config entry exists."""
|
||||
assert await async_setup_component(hass, "usb", {})
|
||||
mock_integration(hass, MockModule("hassio"))
|
||||
|
||||
# Setup the config entry
|
||||
|
||||
Reference in New Issue
Block a user