mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Use snapshot assertion in Tile diagnostic test (#98965)
This commit is contained in:
parent
d300f2d0cc
commit
4e049f9bed
26
tests/components/tile/snapshots/test_diagnostics.ambr
Normal file
26
tests/components/tile/snapshots/test_diagnostics.ambr
Normal file
@ -0,0 +1,26 @@
|
||||
# serializer version: 1
|
||||
# name: test_entry_diagnostics
|
||||
dict({
|
||||
'tiles': list([
|
||||
dict({
|
||||
'accuracy': 13.496111,
|
||||
'altitude': '**REDACTED**',
|
||||
'archetype': 'WALLET',
|
||||
'dead': False,
|
||||
'firmware_version': '01.12.14.0',
|
||||
'hardware_version': '02.09',
|
||||
'kind': 'TILE',
|
||||
'last_timestamp': '2020-08-12T17:55:26',
|
||||
'latitude': '**REDACTED**',
|
||||
'longitude': '**REDACTED**',
|
||||
'lost': False,
|
||||
'lost_timestamp': '1969-12-31T23:59:59.999000',
|
||||
'name': 'Wallet',
|
||||
'ring_state': 'STOPPED',
|
||||
'uuid': '**REDACTED**',
|
||||
'visible': True,
|
||||
'voip_state': 'OFFLINE',
|
||||
}),
|
||||
]),
|
||||
})
|
||||
# ---
|
@ -1,5 +1,6 @@
|
||||
"""Test Tile diagnostics."""
|
||||
from homeassistant.components.diagnostics import REDACTED
|
||||
from syrupy import SnapshotAssertion
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||
@ -11,28 +12,10 @@ async def test_entry_diagnostics(
|
||||
config_entry,
|
||||
hass_client: ClientSessionGenerator,
|
||||
setup_config_entry,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
"""Test config entry diagnostics."""
|
||||
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
|
||||
"tiles": [
|
||||
{
|
||||
"accuracy": 13.496111,
|
||||
"altitude": REDACTED,
|
||||
"archetype": "WALLET",
|
||||
"dead": False,
|
||||
"firmware_version": "01.12.14.0",
|
||||
"hardware_version": "02.09",
|
||||
"kind": "TILE",
|
||||
"last_timestamp": "2020-08-12T17:55:26",
|
||||
"latitude": REDACTED,
|
||||
"longitude": REDACTED,
|
||||
"lost": False,
|
||||
"lost_timestamp": "1969-12-31T23:59:59.999000",
|
||||
"name": "Wallet",
|
||||
"ring_state": "STOPPED",
|
||||
"uuid": REDACTED,
|
||||
"visible": True,
|
||||
"voip_state": "OFFLINE",
|
||||
}
|
||||
]
|
||||
}
|
||||
assert (
|
||||
await get_diagnostics_for_config_entry(hass, hass_client, config_entry)
|
||||
== snapshot
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user