Mock out network.util.async_get_source_ip in tests (#57039)

This commit is contained in:
Erik Montnemery 2021-10-04 15:33:13 +02:00 committed by GitHub
parent 70f4bdf63e
commit 582788026a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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,

View file

@ -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)