2022-04-13 17:22:37 +00:00
|
|
|
"""Test Airly diagnostics."""
|
|
|
|
|
2023-08-22 10:17:43 +00:00
|
|
|
from syrupy import SnapshotAssertion
|
2024-07-29 20:08:46 +00:00
|
|
|
from syrupy.filters import props
|
2023-08-22 10:17:43 +00:00
|
|
|
|
2023-02-09 15:09:13 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2022-04-13 17:22:37 +00:00
|
|
|
|
2022-09-19 07:48:25 +00:00
|
|
|
from . import init_integration
|
|
|
|
|
2022-04-13 17:22:37 +00:00
|
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
2023-02-09 15:09:13 +00:00
|
|
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
|
|
|
from tests.typing import ClientSessionGenerator
|
2022-04-13 17:22:37 +00:00
|
|
|
|
|
|
|
|
2023-02-09 15:09:13 +00:00
|
|
|
async def test_entry_diagnostics(
|
|
|
|
hass: HomeAssistant,
|
|
|
|
aioclient_mock: AiohttpClientMocker,
|
|
|
|
hass_client: ClientSessionGenerator,
|
2023-08-22 10:17:43 +00:00
|
|
|
snapshot: SnapshotAssertion,
|
2023-02-09 15:09:13 +00:00
|
|
|
) -> None:
|
2022-04-13 17:22:37 +00:00
|
|
|
"""Test config entry diagnostics."""
|
|
|
|
entry = await init_integration(hass, aioclient_mock)
|
|
|
|
|
|
|
|
result = await get_diagnostics_for_config_entry(hass, hass_client, entry)
|
|
|
|
|
2024-07-29 20:08:46 +00:00
|
|
|
assert result == snapshot(exclude=props("created_at", "modified_at"))
|