mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +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,
|
MockConfigEntry,
|
||||||
async_capture_events,
|
async_capture_events,
|
||||||
async_fire_mqtt_message,
|
async_fire_mqtt_message,
|
||||||
|
mock_config_flow,
|
||||||
mock_platform,
|
mock_platform,
|
||||||
)
|
)
|
||||||
from tests.typing import (
|
from tests.typing import (
|
||||||
@ -1522,7 +1523,7 @@ async def test_mqtt_integration_discovery_subscribe_unsubscribe(
|
|||||||
"""Test mqtt step."""
|
"""Test mqtt step."""
|
||||||
return self.async_abort(reason="already_configured")
|
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)
|
await asyncio.sleep(0)
|
||||||
assert ("comp/discovery/#", 0) in help_all_subscribe_calls(mqtt_client_mock)
|
assert ("comp/discovery/#", 0) in help_all_subscribe_calls(mqtt_client_mock)
|
||||||
assert not mqtt_client_mock.unsubscribe.called
|
assert not mqtt_client_mock.unsubscribe.called
|
||||||
@ -1575,7 +1576,7 @@ async def test_mqtt_discovery_unsubscribe_once(
|
|||||||
"""Test mqtt step."""
|
"""Test mqtt step."""
|
||||||
return self.async_abort(reason="already_configured")
|
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", "")
|
||||||
async_fire_mqtt_message(hass, "comp/discovery/bla/config", "")
|
async_fire_mqtt_message(hass, "comp/discovery/bla/config", "")
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user