diff --git a/tests/components/watttime/snapshots/test_diagnostics.ambr b/tests/components/watttime/snapshots/test_diagnostics.ambr new file mode 100644 index 00000000000..e1cf4a8a42f --- /dev/null +++ b/tests/components/watttime/snapshots/test_diagnostics.ambr @@ -0,0 +1,32 @@ +# serializer version: 1 +# name: test_entry_diagnostics + dict({ + 'data': dict({ + 'ba': 'CAISO_NORTH', + 'freq': '300', + 'moer': '850.743982', + 'percent': '53', + 'point_time': '2019-01-29T14:55:00.00Z', + }), + 'entry': dict({ + 'data': dict({ + 'balancing_authority': '**REDACTED**', + 'balancing_authority_abbreviation': '**REDACTED**', + 'latitude': '**REDACTED**', + 'longitude': '**REDACTED**', + 'password': '**REDACTED**', + 'username': '**REDACTED**', + }), + 'disabled_by': None, + 'domain': 'watttime', + 'options': dict({ + }), + 'pref_disable_new_entities': False, + 'pref_disable_polling': False, + 'source': 'user', + 'title': '**REDACTED**', + 'unique_id': '**REDACTED**', + 'version': 1, + }), + }) +# --- diff --git a/tests/components/watttime/test_diagnostics.py b/tests/components/watttime/test_diagnostics.py index 8f40e8dbcd2..1f45ba870fc 100644 --- a/tests/components/watttime/test_diagnostics.py +++ b/tests/components/watttime/test_diagnostics.py @@ -1,5 +1,7 @@ """Test WattTime diagnostics.""" -from homeassistant.components.diagnostics import REDACTED +from syrupy import SnapshotAssertion +from syrupy.filters import props + from homeassistant.core import HomeAssistant from tests.components.diagnostics import get_diagnostics_for_config_entry @@ -11,34 +13,9 @@ async def test_entry_diagnostics( config_entry, hass_client: ClientSessionGenerator, setup_watttime, + snapshot: SnapshotAssertion, ) -> None: """Test config entry diagnostics.""" - assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == { - "entry": { - "entry_id": config_entry.entry_id, - "version": 1, - "domain": "watttime", - "title": REDACTED, - "data": { - "username": REDACTED, - "password": REDACTED, - "latitude": REDACTED, - "longitude": REDACTED, - "balancing_authority": REDACTED, - "balancing_authority_abbreviation": REDACTED, - }, - "options": {}, - "pref_disable_new_entities": False, - "pref_disable_polling": False, - "source": "user", - "unique_id": REDACTED, - "disabled_by": None, - }, - "data": { - "freq": "300", - "ba": "CAISO_NORTH", - "percent": "53", - "moer": "850.743982", - "point_time": "2019-01-29T14:55:00.00Z", - }, - } + assert await get_diagnostics_for_config_entry( + hass, hass_client, config_entry + ) == snapshot(exclude=props("entry_id"))