mirror of
https://github.com/home-assistant/core.git
synced 2025-11-15 05:50:13 +00:00
Co-authored-by: Shay Levy <levyshay1@gmail.com> Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
33 lines
986 B
Python
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"),
|
|
)
|