Skip to content

Commit 8e4cfc4

Browse files
committed
Refactor tests & fix one case
Beginning to refactor tests to allow a bit more code re-use. This will become more important for #2 and other integrations that get added.
1 parent d8db481 commit 8e4cfc4

File tree

2 files changed

+262
-46
lines changed

2 files changed

+262
-46
lines changed

tests/snapshots/test_init.ambr

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4534,6 +4534,21 @@
45344534
}),
45354535
])
45364536
# ---
4537+
# name: test_toggle_notifications[entryway_override_expired][events]
4538+
list([
4539+
EventSnapshot({
4540+
'context': <ANY>,
4541+
'data': ReadOnlyDict({
4542+
'entity_id': 'light.entryway',
4543+
'override': 'lampie.override',
4544+
}),
4545+
'event_type': 'lampie.expired',
4546+
'id': <ANY>,
4547+
'origin': 'LOCAL',
4548+
'time_fired': <ANY>,
4549+
}),
4550+
])
4551+
# ---
45374552
# name: test_toggle_notifications[entryway_override_expired][notification_info]
45384553
dict({
45394554
'expiration': ExpirationInfoSnapshot({
@@ -4663,19 +4678,13 @@
46634678
'expiration': ExpirationInfoSnapshot({
46644679
'cancel_listener': None,
46654680
'expires_at': None,
4666-
'started_at': HAFakeDatetime(2025, 5, 20, 3, 51, 32, 3245, tzinfo=zoneinfo.ZoneInfo(key='US/Pacific')),
4681+
'started_at': None,
46674682
}),
46684683
'led_config': tuple(
4669-
dict({
4670-
'brightness': 100.0,
4671-
'color': <Color.GREEN: 90>,
4672-
'duration': None,
4673-
'effect': <Effect.SOLID: 1>,
4674-
}),
46754684
),
46764685
'led_config_source': dict({
4677-
'type': <LEDConfigSourceType.SERVICE: 'service'>,
4678-
'value': 'lampie.override',
4686+
'type': <LEDConfigSourceType.NOTIFICATION: 'notification'>,
4687+
'value': None,
46794688
}),
46804689
'local_protetction_id': 'switch.entryway_local_protection',
46814690
'priorities': tuple(

0 commit comments

Comments
 (0)