mirror of
https://github.com/home-assistant/core.git
synced 2026-07-01 19:57:08 +01:00
e2f3a3232e
Co-authored-by: Claude <noreply@anthropic.com>
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
"""Tests for the Vistapool diagnostics."""
|
|
|
|
from typing import Any
|
|
from unittest.mock import AsyncMock
|
|
|
|
from syrupy.assertion import SnapshotAssertion
|
|
from syrupy.filters import props
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from tests.common import MockConfigEntry
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
|
from tests.typing import ClientSessionGenerator
|
|
|
|
|
|
async def test_entry_diagnostics(
|
|
hass: HomeAssistant,
|
|
hass_client: ClientSessionGenerator,
|
|
snapshot: SnapshotAssertion,
|
|
mock_config_entry: MockConfigEntry,
|
|
mock_vistapool_client: AsyncMock,
|
|
mock_pool_data: dict[str, Any],
|
|
) -> None:
|
|
"""Test config entry diagnostics."""
|
|
mock_pool_data["wifi"] = "gateway-serial-id"
|
|
mock_vistapool_client.fetch_pool_data.return_value = mock_pool_data
|
|
mock_config_entry.add_to_hass(hass)
|
|
|
|
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
|
await hass.async_block_till_done()
|
|
|
|
result = await get_diagnostics_for_config_entry(
|
|
hass, hass_client, mock_config_entry
|
|
)
|
|
|
|
assert result == snapshot(exclude=props("created_at", "modified_at", "entry_id"))
|