2022-04-21 18:38:20 +00:00
|
|
|
"""Test ONVIF diagnostics."""
|
2024-03-08 13:55:15 +00:00
|
|
|
|
2023-08-24 20:40:45 +00:00
|
|
|
from syrupy import SnapshotAssertion
|
2024-07-29 20:08:46 +00:00
|
|
|
from syrupy.filters import props
|
2023-05-11 08:03:31 +00:00
|
|
|
|
2023-02-08 15:48:54 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2022-04-21 18:38:20 +00:00
|
|
|
|
2023-08-24 20:40:45 +00:00
|
|
|
from . import setup_onvif_integration
|
2022-04-21 18:38:20 +00:00
|
|
|
|
|
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
2023-02-08 15:48:54 +00:00
|
|
|
from tests.typing import ClientSessionGenerator
|
2022-04-21 18:38:20 +00:00
|
|
|
|
|
|
|
|
2023-02-08 15:48:54 +00:00
|
|
|
async def test_diagnostics(
|
2023-08-24 20:40:45 +00:00
|
|
|
hass: HomeAssistant,
|
|
|
|
hass_client: ClientSessionGenerator,
|
|
|
|
snapshot: SnapshotAssertion,
|
2023-02-08 15:48:54 +00:00
|
|
|
) -> None:
|
2022-04-21 18:38:20 +00:00
|
|
|
"""Test generating diagnostics for a config entry."""
|
|
|
|
|
|
|
|
entry, _, _ = await setup_onvif_integration(hass)
|
|
|
|
|
2024-07-29 20:08:46 +00:00
|
|
|
assert await get_diagnostics_for_config_entry(hass, hass_client, entry) == snapshot(
|
|
|
|
exclude=props("created_at", "modified_at")
|
|
|
|
)
|