From e22d8086188e4ac5ab7080a1ef67e0516cb214cf Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 8 Feb 2024 12:46:54 +0100 Subject: [PATCH] Prevent network access in emulated_hue tests --- tests/components/emulated_hue/test_init.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/components/emulated_hue/test_init.py b/tests/components/emulated_hue/test_init.py index 8f35997f176bbc..9a872d66946efe 100644 --- a/tests/components/emulated_hue/test_init.py +++ b/tests/components/emulated_hue/test_init.py @@ -1,7 +1,9 @@ """Test the Emulated Hue component.""" from datetime import timedelta 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 ( DATA_KEY, @@ -135,6 +137,9 @@ async def test_setup_works(hass: HomeAssistant) -> None: AsyncMock(), ) as mock_create_upnp_datagram_endpoint, patch( "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( spec=UPNPResponderProtocol