Update tests p-s to use async_get() instead of async_get_registry() (#47654)

This commit is contained in:
Erik Montnemery 2021-03-09 14:28:32 +01:00 committed by GitHub
parent b3fecb1c95
commit ba2978c693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 103 additions and 86 deletions

View file

@ -8,6 +8,7 @@ from homeassistant.components.risco import (
UnauthorizedError,
)
from homeassistant.components.risco.const import DOMAIN
from homeassistant.helpers import entity_registry as er
from homeassistant.util import dt
from .util import TEST_CONFIG, TEST_SITE_UUID, setup_risco
@ -120,7 +121,7 @@ async def test_cannot_connect(hass):
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
registry = await hass.helpers.entity_registry.async_get_registry()
registry = er.async_get(hass)
for id in ENTITY_IDS.values():
assert not registry.async_is_registered(id)
@ -137,7 +138,7 @@ async def test_unauthorized(hass):
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
registry = await hass.helpers.entity_registry.async_get_registry()
registry = er.async_get(hass)
for id in ENTITY_IDS.values():
assert not registry.async_is_registered(id)
@ -167,7 +168,7 @@ def _check_state(hass, category, entity_id):
async def test_setup(hass, two_zone_alarm): # noqa: F811
"""Test entity setup."""
registry = await hass.helpers.entity_registry.async_get_registry()
registry = er.async_get(hass)
for id in ENTITY_IDS.values():
assert not registry.async_is_registered(id)