mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use snapshot test helper in GIOS (#115893)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
This commit is contained in:
parent
b328981868
commit
de1312f7e4
@ -17,7 +17,7 @@ from homeassistant.util.dt import utcnow
|
|||||||
|
|
||||||
from . import init_integration
|
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_sensor(
|
async def test_sensor(
|
||||||
@ -27,13 +27,7 @@ async def test_sensor(
|
|||||||
with patch("homeassistant.components.gios.PLATFORMS", [Platform.SENSOR]):
|
with patch("homeassistant.components.gios.PLATFORMS", [Platform.SENSOR]):
|
||||||
entry = await init_integration(hass)
|
entry = await init_integration(hass)
|
||||||
|
|
||||||
entity_entries = er.async_entries_for_config_entry(entity_registry, entry.entry_id)
|
await snapshot_platform(hass, entity_registry, snapshot, 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")
|
|
||||||
|
|
||||||
|
|
||||||
async def test_availability(hass: HomeAssistant) -> None:
|
async def test_availability(hass: HomeAssistant) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user