Use snapshot test helper in Brother (#115885)

This commit is contained in:
Joost Lekkerkerker 2024-04-20 17:14:42 +02:00 committed by GitHub
parent 16e31d8f74
commit 5796b651af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@ from homeassistant.util.dt import utcnow
from . import init_integration
from tests.common import async_fire_time_changed, load_fixture
from tests.common import async_fire_time_changed, load_fixture, snapshot_platform
async def test_sensors(
@ -34,13 +34,7 @@ async def test_sensors(
with patch("homeassistant.components.brother.PLATFORMS", [Platform.SENSOR]):
entry = await 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)
async def test_availability(hass: HomeAssistant) -> None: