parent
2ea41c90b5
commit
1f80b803f7
|
@ -1,7 +1,5 @@
|
|||
"""Define tests for the Acmeda config flow."""
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.acmeda.const import DOMAIN
|
||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -10,23 +8,13 @@ from homeassistant.helpers import entity_registry as er
|
|||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config_entry(hass: HomeAssistant) -> MockConfigEntry:
|
||||
"""Return the default mocked config entry."""
|
||||
mock_config_entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
data={"host": "127.0.0.1"},
|
||||
)
|
||||
mock_config_entry.add_to_hass(hass)
|
||||
return mock_config_entry
|
||||
|
||||
|
||||
async def test_sensor_id_migration(
|
||||
hass: HomeAssistant, mock_config_entry: MockConfigEntry
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
) -> None:
|
||||
"""Test migrating unique id."""
|
||||
mock_config_entry.add_to_hass(hass)
|
||||
entity_registry = er.async_get(hass)
|
||||
entity_registry.async_get_or_create(
|
||||
SENSOR_DOMAIN, DOMAIN, 1234567890123, config_entry=mock_config_entry
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue