mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Prevent dlna_dmr from opening sockets in tests (#57059)
Supports #55516
This commit is contained in:
parent
77af741099
commit
2f960e558f
@ -139,3 +139,8 @@ def async_get_local_ip_mock() -> Iterable[Mock]:
|
|||||||
) as func:
|
) as func:
|
||||||
func.return_value = AddressFamily.AF_INET, LOCAL_IP
|
func.return_value = AddressFamily.AF_INET, LOCAL_IP
|
||||||
yield func
|
yield func
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def dlna_dmr_mock_get_source_ip(mock_get_source_ip):
|
||||||
|
"""Mock network util's async_get_source_ip."""
|
||||||
|
@ -107,7 +107,9 @@ async def test_event_notifier(
|
|||||||
assert domain_data.stop_listener_remove is None
|
assert domain_data.stop_listener_remove is None
|
||||||
|
|
||||||
|
|
||||||
async def test_cleanup_event_notifiers(hass: HomeAssistant) -> None:
|
async def test_cleanup_event_notifiers(
|
||||||
|
hass: HomeAssistant, aiohttp_notify_servers_mock: Mock
|
||||||
|
) -> None:
|
||||||
"""Test cleanup function clears all event notifiers."""
|
"""Test cleanup function clears all event notifiers."""
|
||||||
domain_data = get_domain_data(hass)
|
domain_data = get_domain_data(hass)
|
||||||
await domain_data.async_get_event_notifier(EventListenAddr(None, 0, None), hass)
|
await domain_data.async_get_event_notifier(EventListenAddr(None, 0, None), hass)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user