core/tests/components/yale/test_diagnostics.py
J. Nick Koston 03ead27f6c
Split august and yale integrations (#124677)
* Split august and yale integrations [part 1] (#122253)

* merge with dev

* Remove unused constant

* Remove yale IPv6 workaround (#123409)

* Convert yale to use oauth (#123806)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update yale for switch from pubnub to websockets (#124675)

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-28 17:46:03 +02:00

32 lines
931 B
Python

"""Test yale diagnostics."""
from syrupy import SnapshotAssertion
from homeassistant.core import HomeAssistant
from .mocks import (
_create_yale_api_with_devices,
_mock_doorbell_from_fixture,
_mock_lock_from_fixture,
)
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
async def test_diagnostics(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
snapshot: SnapshotAssertion,
) -> None:
"""Test generating diagnostics for a config entry."""
lock_one = await _mock_lock_from_fixture(
hass, "get_lock.online_with_doorsense.json"
)
doorbell_one = await _mock_doorbell_from_fixture(hass, "get_doorbell.json")
entry, _, _ = await _create_yale_api_with_devices(hass, [lock_one, doorbell_one])
diag = await get_diagnostics_for_config_entry(hass, hass_client, entry)
assert diag == snapshot