Skip to content

Commit

Permalink
Prevent dlna_dmr from opening sockets in tests (#57059)
Browse files Browse the repository at this point in the history
Supports #55516
  • Loading branch information
bdraco committed Oct 4, 2021
1 parent 77af741 commit 2f960e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/components/dlna_dmr/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
4 changes: 3 additions & 1 deletion tests/components/dlna_dmr/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2f960e5

Please sign in to comment.