Use registry fixtures in tests (s) (#118295)

This commit is contained in:
epenet 2024-05-28 15:41:03 +02:00 committed by GitHub
parent 90500c4b97
commit e58d060f82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 377 additions and 318 deletions

View file

@ -42,7 +42,9 @@ VALUES_BINARY = ["on", "off", "on", "off", "on", "off", "on", "off", "on"]
VALUES_NUMERIC = [17, 20, 15.2, 5, 3.8, 9.2, 6.7, 14, 6]
async def test_unique_id(hass: HomeAssistant) -> None:
async def test_unique_id(
hass: HomeAssistant, entity_registry: er.EntityRegistry
) -> None:
"""Test configuration defined unique_id."""
assert await async_setup_component(
hass,
@ -62,8 +64,7 @@ async def test_unique_id(hass: HomeAssistant) -> None:
)
await hass.async_block_till_done()
entity_reg = er.async_get(hass)
entity_id = entity_reg.async_get_entity_id(
entity_id = entity_registry.async_get_entity_id(
"sensor", STATISTICS_DOMAIN, "uniqueid_sensor_test"
)
assert entity_id == "sensor.test"