mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Prevent network access in emulated_hue tests (#109991)
This commit is contained in:
parent
55f10656a7
commit
c7957f8e94
@ -1,7 +1,9 @@
|
|||||||
"""Test the Emulated Hue component."""
|
"""Test the Emulated Hue component."""
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from unittest.mock import AsyncMock, patch
|
from unittest.mock import AsyncMock, Mock, patch
|
||||||
|
|
||||||
|
from aiohttp import web
|
||||||
|
|
||||||
from homeassistant.components.emulated_hue.config import (
|
from homeassistant.components.emulated_hue.config import (
|
||||||
DATA_KEY,
|
DATA_KEY,
|
||||||
@ -135,6 +137,9 @@ async def test_setup_works(hass: HomeAssistant) -> None:
|
|||||||
AsyncMock(),
|
AsyncMock(),
|
||||||
) as mock_create_upnp_datagram_endpoint, patch(
|
) as mock_create_upnp_datagram_endpoint, patch(
|
||||||
"homeassistant.components.emulated_hue.async_get_source_ip"
|
"homeassistant.components.emulated_hue.async_get_source_ip"
|
||||||
|
), patch(
|
||||||
|
"homeassistant.components.emulated_hue.web.TCPSite",
|
||||||
|
return_value=Mock(spec_set=web.TCPSite),
|
||||||
):
|
):
|
||||||
mock_create_upnp_datagram_endpoint.return_value = AsyncMock(
|
mock_create_upnp_datagram_endpoint.return_value = AsyncMock(
|
||||||
spec=UPNPResponderProtocol
|
spec=UPNPResponderProtocol
|
||||||
|
Loading…
x
Reference in New Issue
Block a user