Use snapshot assertion for wiz diagnostics test (#99154)
This commit is contained in:
parent
bdfdeb2bc0
commit
d94b09655b
2 changed files with 22 additions and 10 deletions
16
tests/components/wiz/snapshots/test_diagnostics.ambr
Normal file
16
tests/components/wiz/snapshots/test_diagnostics.ambr
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# serializer version: 1
|
||||||
|
# name: test_diagnostics
|
||||||
|
dict({
|
||||||
|
'data': dict({
|
||||||
|
'homeId': '**REDACTED**',
|
||||||
|
'mocked': 'mocked',
|
||||||
|
'roomId': '**REDACTED**',
|
||||||
|
}),
|
||||||
|
'entry': dict({
|
||||||
|
'data': dict({
|
||||||
|
'host': '1.1.1.1',
|
||||||
|
}),
|
||||||
|
'title': 'Mock Title',
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
# ---
|
|
@ -1,4 +1,6 @@
|
||||||
"""Test WiZ diagnostics."""
|
"""Test WiZ diagnostics."""
|
||||||
|
from syrupy import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from . import async_setup_integration
|
from . import async_setup_integration
|
||||||
|
@ -8,17 +10,11 @@ from tests.typing import ClientSessionGenerator
|
||||||
|
|
||||||
|
|
||||||
async def test_diagnostics(
|
async def test_diagnostics(
|
||||||
hass: HomeAssistant, hass_client: ClientSessionGenerator
|
hass: HomeAssistant,
|
||||||
|
hass_client: ClientSessionGenerator,
|
||||||
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test generating diagnostics for a config entry."""
|
"""Test generating diagnostics for a config entry."""
|
||||||
_, entry = await async_setup_integration(hass)
|
_, entry = await async_setup_integration(hass)
|
||||||
diag = await get_diagnostics_for_config_entry(hass, hass_client, entry)
|
|
||||||
|
|
||||||
assert diag == {
|
assert await get_diagnostics_for_config_entry(hass, hass_client, entry) == snapshot
|
||||||
"data": {
|
|
||||||
"homeId": "**REDACTED**",
|
|
||||||
"mocked": "mocked",
|
|
||||||
"roomId": "**REDACTED**",
|
|
||||||
},
|
|
||||||
"entry": {"data": {"host": "1.1.1.1"}, "title": "Mock Title"},
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue