mirror of
https://github.com/home-assistant/core.git
synced 2025-04-27 18:57:57 +00:00

* Fetch location data and redact in diagnostics * Implement device tracker * Fix failing tests * Update starlink-grpc-core * Update coveragerc * Hardcode GPS source type * Use translations * Move DEVICE_TRACKERS a little higher in the file * Separate status and location check try/catches * Revert "Separate status and location check try/catches" This reverts commit 7628ec62f639845e9a7f5b460b8c66aad1d1dca3.
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
"""Tests for Starlink diagnostics."""
|
|
from syrupy.assertion import SnapshotAssertion
|
|
|
|
from homeassistant.components.starlink.const import DOMAIN
|
|
from homeassistant.const import CONF_IP_ADDRESS
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .patchers import LOCATION_DATA_SUCCESS_PATCHER, STATUS_DATA_SUCCESS_PATCHER
|
|
|
|
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,
|
|
snapshot: SnapshotAssertion,
|
|
) -> None:
|
|
"""Test generating diagnostics for a config entry."""
|
|
entry = MockConfigEntry(
|
|
domain=DOMAIN,
|
|
data={CONF_IP_ADDRESS: "1.2.3.4:0000"},
|
|
)
|
|
|
|
with STATUS_DATA_SUCCESS_PATCHER, LOCATION_DATA_SUCCESS_PATCHER:
|
|
entry.add_to_hass(hass)
|
|
|
|
await hass.config_entries.async_setup(entry.entry_id)
|
|
await hass.async_block_till_done()
|
|
|
|
diag = await get_diagnostics_for_config_entry(hass, hass_client, entry)
|
|
|
|
assert diag == snapshot
|