mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Clean mqtt patch.dict config entries (#104449)
This commit is contained in:
parent
e03ccb5ab6
commit
b3211fa5ee
@ -34,6 +34,7 @@ from tests.common import (
|
||||
MockConfigEntry,
|
||||
async_capture_events,
|
||||
async_fire_mqtt_message,
|
||||
mock_config_flow,
|
||||
mock_platform,
|
||||
)
|
||||
from tests.typing import (
|
||||
@ -1522,7 +1523,7 @@ async def test_mqtt_integration_discovery_subscribe_unsubscribe(
|
||||
"""Test mqtt step."""
|
||||
return self.async_abort(reason="already_configured")
|
||||
|
||||
with patch.dict(config_entries.HANDLERS, {"comp": TestFlow}):
|
||||
with mock_config_flow("comp", TestFlow):
|
||||
await asyncio.sleep(0)
|
||||
assert ("comp/discovery/#", 0) in help_all_subscribe_calls(mqtt_client_mock)
|
||||
assert not mqtt_client_mock.unsubscribe.called
|
||||
@ -1575,7 +1576,7 @@ async def test_mqtt_discovery_unsubscribe_once(
|
||||
"""Test mqtt step."""
|
||||
return self.async_abort(reason="already_configured")
|
||||
|
||||
with patch.dict(config_entries.HANDLERS, {"comp": TestFlow}):
|
||||
with mock_config_flow("comp", TestFlow):
|
||||
async_fire_mqtt_message(hass, "comp/discovery/bla/config", "")
|
||||
async_fire_mqtt_message(hass, "comp/discovery/bla/config", "")
|
||||
await asyncio.sleep(0.1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user