From 582788026ad9b6c09894452b8fb5106d117c8c50 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 4 Oct 2021 15:33:13 +0200 Subject: [PATCH] Mock out network.util.async_get_source_ip in tests (#57039) --- tests/components/local_ip/test_config_flow.py | 4 ++-- tests/components/local_ip/test_init.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/components/local_ip/test_config_flow.py b/tests/components/local_ip/test_config_flow.py index e3a9ecd9ef8..4804ab83aca 100644 --- a/tests/components/local_ip/test_config_flow.py +++ b/tests/components/local_ip/test_config_flow.py @@ -6,7 +6,7 @@ from homeassistant.config_entries import SOURCE_USER from tests.common import MockConfigEntry -async def test_config_flow(hass): +async def test_config_flow(hass, mock_get_source_ip): """Test we can finish a config flow.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} @@ -21,7 +21,7 @@ async def test_config_flow(hass): assert state -async def test_already_setup(hass): +async def test_already_setup(hass, mock_get_source_ip): """Test we abort if already setup.""" MockConfigEntry( domain=DOMAIN, diff --git a/tests/components/local_ip/test_init.py b/tests/components/local_ip/test_init.py index be1e689ca16..a3fba49b969 100644 --- a/tests/components/local_ip/test_init.py +++ b/tests/components/local_ip/test_init.py @@ -6,7 +6,7 @@ from homeassistant.components.zeroconf import MDNS_TARGET_IP from tests.common import MockConfigEntry -async def test_basic_setup(hass): +async def test_basic_setup(hass, mock_get_source_ip): """Test component setup creates entry from config.""" entry = MockConfigEntry(domain=DOMAIN, data={}) entry.add_to_hass(hass)