mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use snapshot test helper in Analytics insights (#115889)
This commit is contained in:
parent
c94b0a82ca
commit
ee116713cf
@ -16,7 +16,7 @@ from homeassistant.helpers import entity_registry as er
|
|||||||
|
|
||||||
from . import setup_integration
|
from . import setup_integration
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, async_fire_time_changed
|
from tests.common import MockConfigEntry, async_fire_time_changed, snapshot_platform
|
||||||
|
|
||||||
|
|
||||||
async def test_all_entities(
|
async def test_all_entities(
|
||||||
@ -32,17 +32,10 @@ async def test_all_entities(
|
|||||||
[Platform.SENSOR],
|
[Platform.SENSOR],
|
||||||
):
|
):
|
||||||
await setup_integration(hass, mock_config_entry)
|
await setup_integration(hass, mock_config_entry)
|
||||||
entity_entries = er.async_entries_for_config_entry(
|
await snapshot_platform(
|
||||||
entity_registry, mock_config_entry.entry_id
|
hass, entity_registry, snapshot, mock_config_entry.entry_id
|
||||||
)
|
)
|
||||||
|
|
||||||
assert entity_entries
|
|
||||||
for entity_entry in entity_entries:
|
|
||||||
assert hass.states.get(entity_entry.entity_id) == snapshot(
|
|
||||||
name=f"{entity_entry.entity_id}-state"
|
|
||||||
)
|
|
||||||
assert entity_entry == snapshot(name=f"{entity_entry.entity_id}-entry")
|
|
||||||
|
|
||||||
|
|
||||||
async def test_connection_error(
|
async def test_connection_error(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user