Use fixtures in deCONZ diagnostics tests (#120968)

pull/121012/head
Robert Svensson 2024-07-02 12:43:34 +02:00 committed by GitHub
parent 326d24d78b
commit baf2ebf1f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 7 deletions

View File

@ -3,29 +3,25 @@
from pydeconz.websocket import State
from syrupy import SnapshotAssertion
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .test_gateway import setup_deconz_integration
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.test_util.aiohttp import AiohttpClientMocker
from tests.typing import ClientSessionGenerator
async def test_entry_diagnostics(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
aioclient_mock: AiohttpClientMocker,
config_entry_setup: ConfigEntry,
mock_deconz_websocket,
snapshot: SnapshotAssertion,
) -> None:
"""Test config entry diagnostics."""
config_entry = await setup_deconz_integration(hass, aioclient_mock)
await mock_deconz_websocket(state=State.RUNNING)
await hass.async_block_till_done()
assert (
await get_diagnostics_for_config_entry(hass, hass_client, config_entry)
await get_diagnostics_for_config_entry(hass, hass_client, config_entry_setup)
== snapshot
)