hass-core/tests/components/myuplink/test_diagnostics.py
Åke Strandberg 8376c07969
Add myuplink diagnostics download (#109925)
* Dump all relevant data from API

* Cleanup and adjust

* Redact serialNumber

* WIP

* Add fixtures

* WIP

* Tests for diagnostics completed

* Address review comments

* Change to fake token

* Add missed redact

* Improve mocks

* Resolve review comments
2024-02-12 10:56:06 +01:00

26 lines
794 B
Python

"""Tests for the diagnostics data provided by the myuplink integration."""
from syrupy import SnapshotAssertion
from syrupy.filters import paths
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_diagnostics(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
mock_config_entry: MockConfigEntry,
init_integration,
snapshot: SnapshotAssertion,
) -> None:
"""Test diagnostics."""
assert await get_diagnostics_for_config_entry(
hass, hass_client, mock_config_entry
) == snapshot(
exclude=paths("config_entry_data.token.expires_at", "myuplink_test.entry_id")
)