Remove YAML configuration from Local IP (#50642)

This commit is contained in:
Franck Nijhof 2021-05-15 13:45:10 +02:00 committed by GitHub
parent 117860f13b
commit c9b25fe2a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 40 deletions

View file

@ -1,21 +1,18 @@
"""Tests for the local_ip component."""
import pytest
from homeassistant.components.local_ip import DOMAIN
from homeassistant.setup import async_setup_component
from homeassistant.util import get_local_ip
@pytest.fixture(name="config")
def config_fixture():
"""Create hass config fixture."""
return {DOMAIN: {}}
from tests.common import MockConfigEntry
async def test_basic_setup(hass, config):
async def test_basic_setup(hass):
"""Test component setup creates entry from config."""
assert await async_setup_component(hass, DOMAIN, config)
entry = MockConfigEntry(domain=DOMAIN, data={})
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
local_ip = await hass.async_add_executor_job(get_local_ip)
state = hass.states.get(f"sensor.{DOMAIN}")
assert state