mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Use fixtures in deCONZ diagnostics tests (#120968)
This commit is contained in:
parent
326d24d78b
commit
baf2ebf1f2
@ -3,29 +3,25 @@
|
|||||||
from pydeconz.websocket import State
|
from pydeconz.websocket import State
|
||||||
from syrupy import SnapshotAssertion
|
from syrupy import SnapshotAssertion
|
||||||
|
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from .test_gateway import setup_deconz_integration
|
|
||||||
|
|
||||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
|
||||||
from tests.typing import ClientSessionGenerator
|
from tests.typing import ClientSessionGenerator
|
||||||
|
|
||||||
|
|
||||||
async def test_entry_diagnostics(
|
async def test_entry_diagnostics(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
hass_client: ClientSessionGenerator,
|
hass_client: ClientSessionGenerator,
|
||||||
aioclient_mock: AiohttpClientMocker,
|
config_entry_setup: ConfigEntry,
|
||||||
mock_deconz_websocket,
|
mock_deconz_websocket,
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test config entry diagnostics."""
|
"""Test config entry diagnostics."""
|
||||||
config_entry = await setup_deconz_integration(hass, aioclient_mock)
|
|
||||||
|
|
||||||
await mock_deconz_websocket(state=State.RUNNING)
|
await mock_deconz_websocket(state=State.RUNNING)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert (
|
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
|
== snapshot
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user