Simplify webmin tests to use snapshot_platform (#127754)

This commit is contained in:
Sid 2024-10-24 20:10:53 +02:00 committed by GitHub
parent 08eafc54e6
commit 1663d8dfa9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,8 @@ from homeassistant.helpers import entity_registry as er
from .conftest import async_init_integration
from tests.common import snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_sensor(
@ -19,11 +21,4 @@ async def test_sensor(
entry = await async_init_integration(hass)
entity_entries = er.async_entries_for_config_entry(entity_registry, entry.entry_id)
assert entity_entries
for entity_entry in entity_entries:
assert entity_entry == snapshot(name=f"{entity_entry.entity_id}-entry")
assert (state := hass.states.get(entity_entry.entity_id))
assert state == snapshot(name=f"{entity_entry.entity_id}-state")
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)