Prevent dlna_dmr from opening sockets in tests (#57059)

Supports #55516
This commit is contained in:
J. Nick Koston 2021-10-04 08:25:46 -10:00 committed by GitHub
parent 77af741099
commit 2f960e558f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -139,3 +139,8 @@ def async_get_local_ip_mock() -> Iterable[Mock]:
) as func:
func.return_value = AddressFamily.AF_INET, LOCAL_IP
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."""

View File

@ -107,7 +107,9 @@ async def test_event_notifier(
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."""
domain_data = get_domain_data(hass)
await domain_data.async_get_event_notifier(EventListenAddr(None, 0, None), hass)