1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Update tests t-z to use async_get() instead of async_get_registry() (#47655)

This commit is contained in:
Erik Montnemery
2021-03-09 14:25:03 +01:00
committed by GitHub
parent 78b21b1ad1
commit b3fecb1c95
34 changed files with 171 additions and 170 deletions

View File

@@ -15,7 +15,7 @@ from homeassistant.const import (
)
from homeassistant.core import Context
from homeassistant.exceptions import Unauthorized
from homeassistant.helpers import entity_registry
from homeassistant.helpers import entity_registry as er
from tests.common import MockConfigEntry
@@ -244,7 +244,7 @@ async def test_core_config_update(hass):
async def test_reload(hass, hass_admin_user, hass_read_only_user):
"""Test reload service."""
count_start = len(hass.states.async_entity_ids())
ent_reg = await entity_registry.async_get_registry(hass)
ent_reg = er.async_get(hass)
assert await setup.async_setup_component(
hass,
@@ -365,7 +365,7 @@ async def test_ws_delete(hass, hass_ws_client, storage_setup):
input_id = "from_storage"
input_entity_id = f"{DOMAIN}.{input_id}"
ent_reg = await entity_registry.async_get_registry(hass)
ent_reg = er.async_get(hass)
state = hass.states.get(input_entity_id)
assert state is not None
@@ -401,7 +401,7 @@ async def test_update(hass, hass_ws_client, storage_setup):
input_id = "from_storage"
input_entity_id = f"{DOMAIN}.{input_id}"
ent_reg = await entity_registry.async_get_registry(hass)
ent_reg = er.async_get(hass)
state = hass.states.get(input_entity_id)
assert state.attributes["latitude"] == 1
@@ -435,7 +435,7 @@ async def test_ws_create(hass, hass_ws_client, storage_setup):
input_id = "new_input"
input_entity_id = f"{DOMAIN}.{input_id}"
ent_reg = await entity_registry.async_get_registry(hass)
ent_reg = er.async_get(hass)
state = hass.states.get(input_entity_id)
assert state is None