Use snapshot assertion for wiz diagnostics test (#99154)

This commit is contained in:
Jan-Philipp Benecke 2023-09-26 20:03:22 +02:00 committed by GitHub
parent bdfdeb2bc0
commit d94b09655b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 10 deletions

View 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',
}),
})
# ---

View file

@ -1,4 +1,6 @@
"""Test WiZ diagnostics."""
from syrupy import SnapshotAssertion
from homeassistant.core import HomeAssistant
from . import async_setup_integration
@ -8,17 +10,11 @@ from tests.typing import ClientSessionGenerator
async def test_diagnostics(
hass: HomeAssistant, hass_client: ClientSessionGenerator
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
snapshot: SnapshotAssertion,
) -> None:
"""Test generating diagnostics for a config entry."""
_, entry = await async_setup_integration(hass)
diag = await get_diagnostics_for_config_entry(hass, hass_client, entry)
assert diag == {
"data": {
"homeId": "**REDACTED**",
"mocked": "mocked",
"roomId": "**REDACTED**",
},
"entry": {"data": {"host": "1.1.1.1"}, "title": "Mock Title"},
}
assert await get_diagnostics_for_config_entry(hass, hass_client, entry) == snapshot