hass-core/tests/components/myuplink/test_diagnostics.py
Åke Strandberg f5dad1d312
Add myuplink reauth flow (#110587)
* WIP test

* WIP

* WIP Reauth flow. Test fail otherways OK.

* Minor adjustments to tests

* Merge

* Merge

* Next level...

* Cleanup according to review

* It works!

* Simplify setup

* Remove default

* Remove files from PR

* Add back test_init

* Add back test_sensor

* Adjust error message

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-17 10:18:53 +01:00

30 lines
874 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",
"config_entry_data.token.scope",
)
)