2022-03-28 17:42:25 +02:00
|
|
|
"""Test AccuWeather diagnostics."""
|
2024-03-08 14:50:25 +01:00
|
|
|
|
2024-05-06 19:41:48 +02:00
|
|
|
from unittest.mock import AsyncMock
|
|
|
|
|
2023-08-21 09:12:43 +02:00
|
|
|
from syrupy import SnapshotAssertion
|
2022-03-28 17:42:25 +02:00
|
|
|
|
2023-02-08 12:16:23 +01:00
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
|
2022-09-19 09:48:25 +02:00
|
|
|
from . import init_integration
|
|
|
|
|
2022-03-28 17:42:25 +02:00
|
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
2023-02-08 12:16:23 +01:00
|
|
|
from tests.typing import ClientSessionGenerator
|
2022-03-28 17:42:25 +02:00
|
|
|
|
|
|
|
|
2023-02-08 12:16:23 +01:00
|
|
|
async def test_entry_diagnostics(
|
2023-08-21 09:12:43 +02:00
|
|
|
hass: HomeAssistant,
|
|
|
|
hass_client: ClientSessionGenerator,
|
2024-05-06 19:41:48 +02:00
|
|
|
mock_accuweather_client: AsyncMock,
|
2023-08-21 09:12:43 +02:00
|
|
|
snapshot: SnapshotAssertion,
|
2023-02-08 12:16:23 +01:00
|
|
|
) -> None:
|
2022-03-28 17:42:25 +02:00
|
|
|
"""Test config entry diagnostics."""
|
|
|
|
entry = await init_integration(hass)
|
|
|
|
|
|
|
|
result = await get_diagnostics_for_config_entry(hass, hass_client, entry)
|
|
|
|
|
2023-08-21 09:12:43 +02:00
|
|
|
assert result == snapshot
|