2022-10-21 01:02:40 +00:00
|
|
|
"""Test Jellyfin diagnostics."""
|
2024-03-08 13:50:04 +00:00
|
|
|
|
2023-08-21 09:15:58 +00:00
|
|
|
from syrupy import SnapshotAssertion
|
2022-10-21 01:02:40 +00:00
|
|
|
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
2023-02-02 21:29:57 +00:00
|
|
|
from tests.typing import ClientSessionGenerator
|
2022-10-21 01:02:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def test_diagnostics(
|
|
|
|
hass: HomeAssistant,
|
|
|
|
init_integration: MockConfigEntry,
|
2023-02-02 21:29:57 +00:00
|
|
|
hass_client: ClientSessionGenerator,
|
2023-08-21 09:15:58 +00:00
|
|
|
snapshot: SnapshotAssertion,
|
2023-02-13 12:03:51 +00:00
|
|
|
) -> None:
|
2022-10-21 01:02:40 +00:00
|
|
|
"""Test generating diagnostics for a config entry."""
|
2023-08-21 09:15:58 +00:00
|
|
|
data = await get_diagnostics_for_config_entry(hass, hass_client, init_integration)
|
2022-10-21 01:02:40 +00:00
|
|
|
|
2023-08-21 09:15:58 +00:00
|
|
|
assert data["entry"]["data"]["client_device_id"] == init_integration.entry_id
|
|
|
|
data["entry"]["data"]["client_device_id"] = "entry-id"
|
|
|
|
|
|
|
|
assert data == snapshot
|