mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Update tests i-o to use async_get() instead of async_get_registry() (#47653)
This commit is contained in:
@ -28,7 +28,7 @@ from homeassistant.components.input_datetime import (
|
||||
from homeassistant.const import ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, ATTR_NAME
|
||||
from homeassistant.core import Context, CoreState, State
|
||||
from homeassistant.exceptions import Unauthorized
|
||||
from homeassistant.helpers import entity_registry
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
@ -415,7 +415,7 @@ async def test_input_datetime_context(hass, hass_admin_user):
|
||||
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 async_setup_component(
|
||||
hass,
|
||||
@ -544,7 +544,7 @@ async def test_ws_delete(hass, hass_ws_client, storage_setup):
|
||||
|
||||
input_id = "from_storage"
|
||||
input_entity_id = f"{DOMAIN}.datetime_from_storage"
|
||||
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
|
||||
@ -570,7 +570,7 @@ async def test_update(hass, hass_ws_client, storage_setup):
|
||||
|
||||
input_id = "from_storage"
|
||||
input_entity_id = f"{DOMAIN}.datetime_from_storage"
|
||||
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[ATTR_FRIENDLY_NAME] == "datetime from storage"
|
||||
@ -602,7 +602,7 @@ async def test_ws_create(hass, hass_ws_client, storage_setup):
|
||||
|
||||
input_id = "new_datetime"
|
||||
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
|
||||
|
Reference in New Issue
Block a user