Update i-j* tests to use entity & device registry fixtures (#103900)
This commit is contained in:
parent
be2cee228c
commit
92b3c0c96b
20 changed files with 199 additions and 151 deletions
|
@ -11,11 +11,11 @@ from tests.common import MockConfigEntry
|
|||
@pytest.mark.parametrize("platform", ("sensor",))
|
||||
async def test_setup_and_remove_config_entry(
|
||||
hass: HomeAssistant,
|
||||
entity_registry: er.EntityRegistry,
|
||||
platform: str,
|
||||
) -> None:
|
||||
"""Test setting up and removing a config entry."""
|
||||
input_sensor_entity_id = "sensor.input"
|
||||
registry = er.async_get(hass)
|
||||
integration_entity_id = f"{platform}.my_integration"
|
||||
|
||||
# Setup the config entry
|
||||
|
@ -37,7 +37,7 @@ async def test_setup_and_remove_config_entry(
|
|||
await hass.async_block_till_done()
|
||||
|
||||
# Check the entity is registered in the entity registry
|
||||
assert registry.async_get(integration_entity_id) is not None
|
||||
assert entity_registry.async_get(integration_entity_id) is not None
|
||||
|
||||
# Check the platform is setup correctly
|
||||
state = hass.states.get(integration_entity_id)
|
||||
|
@ -58,4 +58,4 @@ async def test_setup_and_remove_config_entry(
|
|||
|
||||
# Check the state and entity registry entry are removed
|
||||
assert hass.states.get(integration_entity_id) is None
|
||||
assert registry.async_get(integration_entity_id) is None
|
||||
assert entity_registry.async_get(integration_entity_id) is None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue