From d94b09655b78e69c1497ccf3cbca5e15569a49b0 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Tue, 26 Sep 2023 20:03:22 +0200 Subject: [PATCH] Use snapshot assertion for wiz diagnostics test (#99154) --- .../wiz/snapshots/test_diagnostics.ambr | 16 ++++++++++++++++ tests/components/wiz/test_diagnostics.py | 16 ++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 tests/components/wiz/snapshots/test_diagnostics.ambr diff --git a/tests/components/wiz/snapshots/test_diagnostics.ambr b/tests/components/wiz/snapshots/test_diagnostics.ambr new file mode 100644 index 00000000000..5fe9aa883a1 --- /dev/null +++ b/tests/components/wiz/snapshots/test_diagnostics.ambr @@ -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', + }), + }) +# --- diff --git a/tests/components/wiz/test_diagnostics.py b/tests/components/wiz/test_diagnostics.py index 3bc95cf57ff..ef26e63069b 100644 --- a/tests/components/wiz/test_diagnostics.py +++ b/tests/components/wiz/test_diagnostics.py @@ -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