core/tests/components/ccm15/test_diagnostics.py

39 lines
1.0 KiB
Python

"""Test CCM15 diagnostics."""
from unittest.mock import AsyncMock
from syrupy import SnapshotAssertion
from homeassistant.components.ccm15.const import DOMAIN
from homeassistant.const import CONF_HOST, CONF_PORT
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,
ccm15_device: AsyncMock,
snapshot: SnapshotAssertion,
) -> None:
"""Test config entry diagnostics."""
entry = MockConfigEntry(
domain=DOMAIN,
unique_id="1.1.1.1",
data={
CONF_HOST: "1.1.1.1",
CONF_PORT: 80,
},
)
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
result = await get_diagnostics_for_config_entry(hass, hass_client, entry)
assert result == snapshot