mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use mock_config_flow helper in bootstrap tests (#117240)
This commit is contained in:
parent
021b057a87
commit
35900cd579
@ -27,6 +27,7 @@ from .common import (
|
|||||||
MockModule,
|
MockModule,
|
||||||
MockPlatform,
|
MockPlatform,
|
||||||
get_test_config_dir,
|
get_test_config_dir,
|
||||||
|
mock_config_flow,
|
||||||
mock_integration,
|
mock_integration,
|
||||||
mock_platform,
|
mock_platform,
|
||||||
)
|
)
|
||||||
@ -1146,7 +1147,6 @@ async def test_bootstrap_empty_integrations(
|
|||||||
@pytest.fixture(name="mock_mqtt_config_flow")
|
@pytest.fixture(name="mock_mqtt_config_flow")
|
||||||
def mock_mqtt_config_flow_fixture() -> Generator[None, None, None]:
|
def mock_mqtt_config_flow_fixture() -> Generator[None, None, None]:
|
||||||
"""Mock MQTT config flow."""
|
"""Mock MQTT config flow."""
|
||||||
original_mqtt = HANDLERS.get("mqtt")
|
|
||||||
|
|
||||||
@HANDLERS.register("mqtt")
|
@HANDLERS.register("mqtt")
|
||||||
class MockConfigFlow:
|
class MockConfigFlow:
|
||||||
@ -1155,11 +1155,8 @@ def mock_mqtt_config_flow_fixture() -> Generator[None, None, None]:
|
|||||||
VERSION = 1
|
VERSION = 1
|
||||||
MINOR_VERSION = 1
|
MINOR_VERSION = 1
|
||||||
|
|
||||||
yield
|
with mock_config_flow("mqtt", MockConfigFlow):
|
||||||
if original_mqtt:
|
yield
|
||||||
HANDLERS["mqtt"] = original_mqtt
|
|
||||||
else:
|
|
||||||
HANDLERS.pop("mqtt")
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("integration", ["mqtt_eventstream", "mqtt_statestream"])
|
@pytest.mark.parametrize("integration", ["mqtt_eventstream", "mqtt_statestream"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user