Use snapshot assertion for lametric diagnostics test (#99164)
This commit is contained in:
parent
475cb7719b
commit
bb7ddddd4c
2 changed files with 54 additions and 42 deletions
|
@ -1,6 +1,6 @@
|
|||
"""Tests for the diagnostics data provided by the LaMetric integration."""
|
||||
from syrupy import SnapshotAssertion
|
||||
|
||||
from homeassistant.components.diagnostics import REDACTED
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
@ -12,46 +12,10 @@ async def test_diagnostics(
|
|||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
init_integration: MockConfigEntry,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
"""Test diagnostics."""
|
||||
assert await get_diagnostics_for_config_entry(
|
||||
hass, hass_client, init_integration
|
||||
) == {
|
||||
"device_id": REDACTED,
|
||||
"name": REDACTED,
|
||||
"serial_number": REDACTED,
|
||||
"os_version": "2.2.2",
|
||||
"mode": "auto",
|
||||
"model": "LM 37X8",
|
||||
"audio": {
|
||||
"volume": 100,
|
||||
"volume_range": {"range_min": 0, "range_max": 100},
|
||||
"volume_limit": {"range_min": 0, "range_max": 100},
|
||||
},
|
||||
"bluetooth": {
|
||||
"available": True,
|
||||
"name": REDACTED,
|
||||
"active": False,
|
||||
"discoverable": True,
|
||||
"pairable": True,
|
||||
"address": "AA:BB:CC:DD:EE:FF",
|
||||
},
|
||||
"display": {
|
||||
"brightness": 100,
|
||||
"brightness_mode": "auto",
|
||||
"width": 37,
|
||||
"height": 8,
|
||||
"display_type": "mixed",
|
||||
},
|
||||
"wifi": {
|
||||
"active": True,
|
||||
"mac": "AA:BB:CC:DD:EE:FF",
|
||||
"available": True,
|
||||
"encryption": "WPA",
|
||||
"ssid": REDACTED,
|
||||
"ip": "127.0.0.1",
|
||||
"mode": "dhcp",
|
||||
"netmask": "255.255.255.0",
|
||||
"rssi": 21,
|
||||
},
|
||||
}
|
||||
assert (
|
||||
await get_diagnostics_for_config_entry(hass, hass_client, init_integration)
|
||||
== snapshot
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue