mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
parent
2ea41c90b5
commit
1f80b803f7
@ -1,7 +1,5 @@
|
|||||||
"""Define tests for the Acmeda config flow."""
|
"""Define tests for the Acmeda config flow."""
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from homeassistant.components.acmeda.const import DOMAIN
|
from homeassistant.components.acmeda.const import DOMAIN
|
||||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -10,23 +8,13 @@ from homeassistant.helpers import entity_registry as er
|
|||||||
from tests.common import MockConfigEntry
|
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(
|
async def test_sensor_id_migration(
|
||||||
hass: HomeAssistant, mock_config_entry: MockConfigEntry
|
hass: HomeAssistant,
|
||||||
|
mock_config_entry: MockConfigEntry,
|
||||||
|
entity_registry: er.EntityRegistry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test migrating unique id."""
|
"""Test migrating unique id."""
|
||||||
mock_config_entry.add_to_hass(hass)
|
mock_config_entry.add_to_hass(hass)
|
||||||
entity_registry = er.async_get(hass)
|
|
||||||
entity_registry.async_get_or_create(
|
entity_registry.async_get_or_create(
|
||||||
SENSOR_DOMAIN, DOMAIN, 1234567890123, config_entry=mock_config_entry
|
SENSOR_DOMAIN, DOMAIN, 1234567890123, config_entry=mock_config_entry
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user