Files
core/tests/components/portainer/test_diagnostics.py
Erwin Douna 6394fdbc97 Add diagnostics to portainer (#153126)
Co-authored-by: Shay Levy <levyshay1@gmail.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2025-10-27 17:14:16 +02:00

33 lines
986 B
Python

"""Test the Portainer component diagnostics."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.core import HomeAssistant
from . import setup_integration
from tests.common import MockConfigEntry
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
async def test_get_config_entry_diagnostics(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_portainer_client: AsyncMock,
mock_config_entry: MockConfigEntry,
hass_client: ClientSessionGenerator,
) -> None:
"""Test if get_config_entry_diagnostics returns the correct data."""
await setup_integration(hass, mock_config_entry)
diagnostics_entry = await get_diagnostics_for_config_entry(
hass, hass_client, mock_config_entry
)
assert diagnostics_entry == snapshot(
exclude=props("created_at", "modified_at"),
)