2022-01-20 03:13:49 +00:00
|
|
|
"""Test Ambient PWS diagnostics."""
|
2024-03-08 13:50:25 +00:00
|
|
|
|
2023-08-21 17:46:36 +00:00
|
|
|
from syrupy import SnapshotAssertion
|
|
|
|
|
2024-05-02 11:42:16 +00:00
|
|
|
from homeassistant.components.ambient_station import AmbientStationConfigEntry
|
2023-02-09 15:09:13 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2022-01-20 03:13:49 +00:00
|
|
|
|
|
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
2023-02-09 15:09:13 +00:00
|
|
|
from tests.typing import ClientSessionGenerator
|
2022-01-20 03:13:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def test_entry_diagnostics(
|
2023-02-09 15:09:13 +00:00
|
|
|
hass: HomeAssistant,
|
2024-05-02 11:42:16 +00:00
|
|
|
config_entry: AmbientStationConfigEntry,
|
2023-02-09 15:09:13 +00:00
|
|
|
hass_client: ClientSessionGenerator,
|
|
|
|
data_station,
|
|
|
|
setup_config_entry,
|
2023-08-21 17:46:36 +00:00
|
|
|
snapshot: SnapshotAssertion,
|
2023-02-09 15:09:13 +00:00
|
|
|
) -> None:
|
2022-01-20 03:13:49 +00:00
|
|
|
"""Test config entry diagnostics."""
|
2024-05-02 11:42:16 +00:00
|
|
|
ambient = config_entry.runtime_data
|
2022-12-31 00:09:38 +00:00
|
|
|
ambient.stations = data_station
|
2023-08-21 17:46:36 +00:00
|
|
|
assert (
|
|
|
|
await get_diagnostics_for_config_entry(hass, hass_client, config_entry)
|
|
|
|
== snapshot
|
|
|
|
)
|