Update tests c-h to use registry async_get (#47652)

This commit is contained in:
Erik Montnemery 2021-03-09 14:31:17 +01:00 committed by GitHub
parent ba2978c693
commit 87e7cebd36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 165 additions and 138 deletions

View file

@ -1,6 +1,6 @@
"""Test init of Coronavirus integration."""
from homeassistant.components.coronavirus.const import DOMAIN, OPTION_WORLDWIDE
from homeassistant.helpers import entity_registry
from homeassistant.helpers import entity_registry as er
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry, mock_registry
@ -17,13 +17,13 @@ async def test_migration(hass):
mock_registry(
hass,
{
"sensor.netherlands_confirmed": entity_registry.RegistryEntry(
"sensor.netherlands_confirmed": er.RegistryEntry(
entity_id="sensor.netherlands_confirmed",
unique_id="34-confirmed",
platform="coronavirus",
config_entry_id=nl_entry.entry_id,
),
"sensor.worldwide_confirmed": entity_registry.RegistryEntry(
"sensor.worldwide_confirmed": er.RegistryEntry(
entity_id="sensor.worldwide_confirmed",
unique_id="__worldwide-confirmed",
platform="coronavirus",
@ -34,7 +34,7 @@ async def test_migration(hass):
assert await async_setup_component(hass, DOMAIN, {})
await hass.async_block_till_done()
ent_reg = await entity_registry.async_get_registry(hass)
ent_reg = er.async_get(hass)
sensor_nl = ent_reg.async_get("sensor.netherlands_confirmed")
assert sensor_nl.unique_id == "Netherlands-confirmed"