Skip to content

Commit

Permalink
check assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
niccokunzmann committed Aug 16, 2022
1 parent 6786a09 commit 8a57a27
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/icalendar/tests/issue_321_assert_dst_offset_is_not_false.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//PIMUTILS.ORG//NONSGML khal / icalendar //EN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
DTSTART;VALUE=DATE-TIME:20200329T030000
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
SUMMARY:Reifenwechsel
DTSTART;TZID=Europe/Berlin;VALUE=DATE-TIME:20200403T102000
DTEND;TZID=Europe/Berlin;VALUE=DATE-TIME:20200403T113000
DTSTAMP;VALUE=DATE-TIME:20200326T165608Z
UID:TCK6EMQBQHQ8KB4PDQPT04Q7HBYNS2MEPZMO
SEQUENCE:0
LOCATION:Musterhausen
END:VEVENT
END:VCALENDAR
11 changes: 11 additions & 0 deletions src/icalendar/tests/test_fixed_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,17 @@ def test_issue_237(self):
self.assertEqual(dtstart.tzinfo.zone, expected_zone)
self.assertEqual(dtstart.tzname(), expected_tzname)

def test_issue_321_assert_dst_offset_is_not_false(self):
"""This tests the assertion hitting for a calendar.
See https://github.com/collective/icalendar/issues/321
"""
directory = os.path.dirname(__file__)
path = os.path.join(directory,
'issue_321_assert_dst_offset_is_not_false.ics')
with open(path, 'rb') as ics:
cal = icalendar.Calendar.from_ical(ics.read()) # assertion should fail

def test_issue_345(self):
"""Issue #345 - Why is tools.UIDGenerator a class (that must be instantiated) instead of a module? """
uid1 = icalendar.tools.UIDGenerator.uid()
Expand Down

0 comments on commit 8a57a27

Please sign in to comment.