diff --git a/radicale/tests/static/event_full_day_rrule_count_500.ics b/radicale/tests/static/event_full_day_rrule_count_500.ics new file mode 100644 index 00000000..bdde555d --- /dev/null +++ b/radicale/tests/static/event_full_day_rrule_count_500.ics @@ -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 + diff --git a/radicale/tests/static/event_full_day_rrule_until_2y.ics b/radicale/tests/static/event_full_day_rrule_until_2y.ics new file mode 100644 index 00000000..aa5a6501 --- /dev/null +++ b/radicale/tests/static/event_full_day_rrule_until_2y.ics @@ -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 + diff --git a/radicale/tests/static/event_full_day_rrule_until_5000y.ics b/radicale/tests/static/event_full_day_rrule_until_5000y.ics new file mode 100644 index 00000000..7296c199 --- /dev/null +++ b/radicale/tests/static/event_full_day_rrule_until_5000y.ics @@ -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 + diff --git a/radicale/tests/static/event_full_day_rrule_until_50y.ics b/radicale/tests/static/event_full_day_rrule_until_50y.ics new file mode 100644 index 00000000..59580855 --- /dev/null +++ b/radicale/tests/static/event_full_day_rrule_until_50y.ics @@ -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 + diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 47f4ee2d..983f08b7 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -328,6 +328,41 @@ permissions: RrWw""") event = get_file_content("event_mixed_datetime_and_date.ics") 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: """Test event with EXDATE but not having RRULE.""" self.mkcalendar("/calendar.ics/")