2022-01-21 19:20:59 +00:00
|
|
|
"""Test the CO2Signal diagnostics."""
|
|
|
|
|
2023-11-24 17:56:58 +00:00
|
|
|
import pytest
|
2023-08-23 23:18:49 +00:00
|
|
|
from syrupy import SnapshotAssertion
|
2024-07-29 20:08:46 +00:00
|
|
|
from syrupy.filters import props
|
2023-08-23 23:18:49 +00:00
|
|
|
|
2023-02-08 17:08:43 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2022-01-21 19:20:59 +00:00
|
|
|
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
2023-02-08 17:08:43 +00:00
|
|
|
from tests.typing import ClientSessionGenerator
|
2022-01-21 19:20:59 +00:00
|
|
|
|
|
|
|
|
2023-11-24 17:56:58 +00:00
|
|
|
@pytest.mark.usefixtures("setup_integration")
|
2023-02-08 17:08:43 +00:00
|
|
|
async def test_entry_diagnostics(
|
2023-08-23 23:18:49 +00:00
|
|
|
hass: HomeAssistant,
|
|
|
|
hass_client: ClientSessionGenerator,
|
2023-11-24 17:56:58 +00:00
|
|
|
config_entry: MockConfigEntry,
|
2023-08-23 23:18:49 +00:00
|
|
|
snapshot: SnapshotAssertion,
|
2023-02-08 17:08:43 +00:00
|
|
|
) -> None:
|
2022-01-21 19:20:59 +00:00
|
|
|
"""Test config entry diagnostics."""
|
|
|
|
result = await get_diagnostics_for_config_entry(hass, hass_client, config_entry)
|
|
|
|
|
2024-07-29 20:08:46 +00:00
|
|
|
assert result == snapshot(exclude=props("created_at", "modified_at"))
|