2022-01-20 22:47:42 +00:00
|
|
|
"""Test deCONZ diagnostics."""
|
2024-03-08 13:50:25 +00:00
|
|
|
|
2022-08-05 23:34:27 +00:00
|
|
|
from pydeconz.websocket import State
|
2023-08-23 19:37:03 +00:00
|
|
|
from syrupy import SnapshotAssertion
|
2022-01-20 22:47:42 +00:00
|
|
|
|
2024-07-02 10:43:34 +00:00
|
|
|
from homeassistant.config_entries import ConfigEntry
|
2023-02-11 07:26:13 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2022-01-20 22:47:42 +00:00
|
|
|
|
2024-07-05 20:35:06 +00:00
|
|
|
from .conftest import WebsocketStateType
|
|
|
|
|
2022-01-20 22:47:42 +00:00
|
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
2023-02-11 07:26:13 +00:00
|
|
|
from tests.typing import ClientSessionGenerator
|
2022-01-20 22:47:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def test_entry_diagnostics(
|
2023-02-11 07:26:13 +00:00
|
|
|
hass: HomeAssistant,
|
|
|
|
hass_client: ClientSessionGenerator,
|
2024-07-02 10:43:34 +00:00
|
|
|
config_entry_setup: ConfigEntry,
|
2024-07-05 20:35:06 +00:00
|
|
|
mock_websocket_state: WebsocketStateType,
|
2023-08-23 19:37:03 +00:00
|
|
|
snapshot: SnapshotAssertion,
|
2023-02-11 07:26:13 +00:00
|
|
|
) -> None:
|
2022-01-20 22:47:42 +00:00
|
|
|
"""Test config entry diagnostics."""
|
2024-07-05 20:35:06 +00:00
|
|
|
await mock_websocket_state(State.RUNNING)
|
2022-01-20 22:47:42 +00:00
|
|
|
await hass.async_block_till_done()
|
|
|
|
|
2023-08-23 19:37:03 +00:00
|
|
|
assert (
|
2024-07-02 10:43:34 +00:00
|
|
|
await get_diagnostics_for_config_entry(hass, hass_client, config_entry_setup)
|
2023-08-23 19:37:03 +00:00
|
|
|
== snapshot
|
|
|
|
)
|