Skip to content

Commit

Permalink
Merge pull request #33 from da4089/master
Browse files Browse the repository at this point in the history
Add basic tests for Radicale issues
  • Loading branch information
da4089 committed Mar 25, 2024
2 parents 671e32b + bf98703 commit 8f72c86
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test_files/radicale-0816.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//PYVOBJECT//NONSGML Version 1//EN
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:STANDARD
DTSTART:20001029T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:GMT
TZOFFSETFROM:+0100
TZOFFSETTO:+0000
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20000326T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZNAME:BST
TZOFFSETFROM:+0000
TZOFFSETTO:+0100
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:6b6fbf57-ea05-4717-a62e-24b314bd72af
DTSTART;TZID=Europe/London:20160616T090000
DTEND;TZID=Europe/London:20160616T162000
CATEGORIES:My special category
CREATED:20160413T143427Z
DESCRIPTION:Description
DTSTAMP:20160413T143524Z
LAST-MODIFIED:20160413T143524Z
LOCATION:Secret Location
SUMMARY:STG
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
74 changes: 74 additions & 0 deletions test_files/radicale-0827.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Paris
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20171006T120227Z
LAST-MODIFIED:20180509T072357Z
DTSTAMP:20180509T072357Z
UID:812dae9d-4114-45c1-ba5b-4ee34756ab47
SUMMARY:Cours Balboa
RRULE:FREQ=WEEKLY;UNTIL=20180623T183000Z
EXDATE:20171023T183000Z
EXDATE:20171030T193000Z
EXDATE:20171225T193000Z
EXDATE:20180101T193000Z
EXDATE:20180212T193000Z
EXDATE:20180219T193000Z
EXDATE:20180409T183000Z
EXDATE:20180416T183000Z
EXDATE:20180402T183000Z
DTSTART;TZID=Europe/Paris:20171009T203000
DTEND;TZID=Europe/Paris:20171009T213000
TRANSP:OPAQUE
SEQUENCE:8
X-MOZ-GENERATION:10
LOCATION:Some place\, Some where
END:VEVENT
BEGIN:VEVENT
CREATED:20180327T075738Z
LAST-MODIFIED:20180327T075754Z
DTSTAMP:20180327T075754Z
UID:812dae9d-4114-45c1-ba5b-4ee34756ab47
SUMMARY:Cours Balboa
STATUS:CANCELLED
RECURRENCE-ID;TZID=Europe/Paris:20180326T203000
DTSTART;TZID=Europe/Paris:20180326T203000
DTEND;TZID=Europe/Paris:20180326T213000
TRANSP:OPAQUE
SEQUENCE:8
X-MOZ-GENERATION:8
LOCATION:Some place\, Some where
END:VEVENT
BEGIN:VEVENT
CREATED:20180509T072349Z
LAST-MODIFIED:20180509T072357Z
DTSTAMP:20180509T072357Z
UID:812dae9d-4114-45c1-ba5b-4ee34756ab47
SUMMARY:Cours Balboa
STATUS:CANCELLED
RECURRENCE-ID;TZID=Europe/Paris:20180430T203000
DTSTART;TZID=Europe/Paris:20180430T203000
DTEND;TZID=Europe/Paris:20180430T213000
TRANSP:OPAQUE
SEQUENCE:9
X-MOZ-GENERATION:10
LOCATION:Some place\, Some where
END:VEVENT
END:VCALENDAR
17 changes: 17 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,5 +957,22 @@ def test_change_tz_default(self):
self.assertEqual(vevent.dtend.value, expected_datepair[1])


class TestCompatibility(unittest.TestCase):

def test_radicale_0816(self):
ics_str = get_test_file("radicale-0816.ics")
vobjs = base.readComponents(ics_str, allowQP=True)
for vo in vobjs:
self.assertIsNotNone(vo)
return

def test_radicale_0827(self):
ics_str = get_test_file("radicale-0827.ics")
vobjs = base.readComponents(ics_str, allowQP=True)
for vo in vobjs:
self.assertIsNotNone(vo)
return


if __name__ == '__main__':
unittest.main()

0 comments on commit 8f72c86

Please sign in to comment.