Bound calendar recurrence expansion and retain MQTT license
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user