max_vevent_rrule_entries: test cases

This commit is contained in:
Peter Bieringer
2026-08-01 18:56:13 +02:00
parent bcb5061416
commit 320ad29424
5 changed files with 159 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=US/Eastern:20060102
DTEND;TZID=US/Eastern:20060103
RRULE:FREQ=DAILY;COUNT=500
SUMMARY:Recurring event with count 500
UID:event_full_day_rrule_count_500
DTSTAMP:20060102T094829Z
END:VEVENT
END:VCALENDAR

View File

@@ -0,0 +1,31 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=US/Eastern:20060102
DTEND;TZID=US/Eastern:20060103
RRULE:FREQ=DAILY;UNTIL=20080101
SUMMARY:Recurring event with until +2y
UID:event_full_day_rrule_until_2y
DTSTAMP:20060102T094829Z
END:VEVENT
END:VCALENDAR

View File

@@ -0,0 +1,31 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=US/Eastern:20060102
DTEND;TZID=US/Eastern:20060103
RRULE:FREQ=DAILY;UNTIL=70060101
SUMMARY:Recurring event with until +5000y
UID:event_full_day_rrule_until_5000y
DTSTAMP:20060102T094829Z
END:VEVENT
END:VCALENDAR

View File

@@ -0,0 +1,31 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=US/Eastern:20060102
DTEND;TZID=US/Eastern:20060103
RRULE:FREQ=DAILY;UNTIL=20560101
SUMMARY:Recurring event with until +50y
UID:event_full_day_rrule_until_50y
DTSTAMP:20060102T094829Z
END:VEVENT
END:VCALENDAR

View File

@@ -328,6 +328,41 @@ permissions: RrWw""")
event = get_file_content("event_mixed_datetime_and_date.ics") event = get_file_content("event_mixed_datetime_and_date.ics")
self.put("/calendar.ics/event.ics", event) self.put("/calendar.ics/event.ics", event)
def test_add_event_with_rrule_count_500_limit_100(self) -> None:
"""Test event with RRULE COUNT=500 and limit 100."""
self.configure({"server": {"max_vevent_rrule_entries": 100}})
self.mkcalendar("/calendar.ics/")
event = get_file_content("event_full_day_rrule_count_500.ics")
self.put("/calendar.ics/event.ics", event, check=400)
def test_add_event_with_rrule_count_500_limit_600(self) -> None:
"""Test event with RRULE COUNT=500 and limit 600."""
self.configure({"server": {"max_vevent_rrule_entries": 600}})
self.mkcalendar("/calendar.ics/")
event = get_file_content("event_full_day_rrule_count_500.ics")
self.put("/calendar.ics/event.ics", event)
def test_add_event_with_rrule_until_2y_limit_100(self) -> None:
"""Test event with RRULE UNTIL=+2y and limit 100."""
self.configure({"server": {"max_vevent_rrule_entries": 100}})
self.mkcalendar("/calendar.ics/")
event = get_file_content("event_full_day_rrule_until_2y.ics")
self.put("/calendar.ics/event.ics", event, check=400)
def test_add_event_with_rrule_until_50y_limit_100(self) -> None:
"""Test event with RRULE UNTIL=+50y and limit 100."""
self.configure({"server": {"max_vevent_rrule_entries": 100}})
self.mkcalendar("/calendar.ics/")
event = get_file_content("event_full_day_rrule_until_50y.ics")
self.put("/calendar.ics/event.ics", event, check=400)
def test_add_event_with_rrule_until_5000y_limit_100(self) -> None:
"""Test event with RRULE UNTIL=+5000y and limit 100."""
self.configure({"server": {"max_vevent_rrule_entries": 100}})
self.mkcalendar("/calendar.ics/")
event = get_file_content("event_full_day_rrule_until_5000y.ics")
self.put("/calendar.ics/event.ics", event, check=400)
def test_add_event_with_exdate_without_rrule(self) -> None: def test_add_event_with_exdate_without_rrule(self) -> None:
"""Test event with EXDATE but not having RRULE.""" """Test event with EXDATE but not having RRULE."""
self.mkcalendar("/calendar.ics/") self.mkcalendar("/calendar.ics/")