Bound calendar recurrence expansion and retain MQTT license

This commit is contained in:
Pigway
2026-10-08 23:52:06 +08:00
parent 8209aadbb8
commit 32229609c9
4 changed files with 94 additions and 3 deletions
+30
View File
@@ -58,3 +58,33 @@ def test_timezone_and_past_filter():
)["events"]
== []
)
def test_dense_recurrence_is_bounded():
rule = (
"FREQ=DAILY;BYHOUR="
+ ",".join(map(str, range(24)))
+ ";BYMINUTE="
+ ",".join(map(str, range(60)))
)
with pytest.raises(FlowError):
calendar_events(
feed("DTSTART:20261008T000000Z\r\nRRULE:" + rule + "\r\nSUMMARY:Too many"),
datetime(2026, 10, 8, tzinfo=UTC),
)
def test_exrule_not_silently_ignored():
with pytest.raises(FlowError):
calendar_events(
feed("DTSTART:20261008T080000Z\r\nEXRULE:FREQ=DAILY\r\nSUMMARY:Excluded"),
datetime(2026, 10, 8, tzinfo=UTC),
)
def test_all_day_today_in_local_timezone():
result = calendar_events(
feed("DTSTART;VALUE=DATE:20261008\r\nSUMMARY:Today"),
datetime(2026, 10, 8, 1, tzinfo=UTC),
)
assert len(result["events"]) == 1