Skip to content

Commit

Permalink
Merge branch 'master' into test_restructure_issue_55
Browse files Browse the repository at this point in the history
  • Loading branch information
jacadzaca authored Sep 20, 2022
2 parents 8a3d665 + 11591c0 commit 54cfb78
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
BEGIN:VEVENT
DTSTAMP:20120605T003759Z
DTSTART;TZID=America/New_York:20120712T183000
DTEND;TZID=America/New_York:20120712T213000
STATUS:CONFIRMED
SUMMARY:DevOps DC Meetup
DESCRIPTION:DevOpsDC\nThursday\, July 12 at 6:30 PM\n\nThis will be a joi
nt meetup / hack night with the DC jQuery Users Group. The idea behind
the hack night: Small teams consisting of at least 1 member...\n\nDeta
ils: http://www.meetup.com/DevOpsDC/events/47635522/
CLASS:PUBLIC
CREATED:20120111T120339Z
GEO:38.90;-77.01
LOCATION:Fathom Creative\, Inc. (1333 14th Street Northwest\, Washington
D.C.\, DC 20005)
URL:http://www.meetup.com/DevOpsDC/events/47635522/
LAST-MODIFIED:20120522T174406Z
UID:event_qtkfrcyqkbnb@meetup.com
END:VEVENT
20 changes: 0 additions & 20 deletions src/icalendar/tests/test_fixed_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,6 @@
from backports import zoneinfo

class TestIssues(unittest.TestCase):
def test_issue_53(self):
"""Issue #53 - Parsing failure on some descriptions?
https://github.com/collective/icalendar/issues/53
"""

directory = os.path.dirname(__file__)
ics = open(os.path.join(directory, 'issue_53_parsing_failure.ics'),
'rb')
cal = icalendar.Calendar.from_ical(ics.read())
ics.close()

event = cal.walk('VEVENT')[0]
desc = event.get('DESCRIPTION')
self.assertTrue(b'July 12 at 6:30 PM' in desc.to_ical())

timezones = cal.walk('VTIMEZONE')
self.assertEqual(len(timezones), 1)
tz = timezones[0]
self.assertEqual(tz['tzid'].to_ical(), b"America/New_York")

def test_issue_58(self):
"""Issue #58 - TZID on UTC DATE-TIMEs
https://github.com/collective/icalendar/issues/58
Expand Down
13 changes: 13 additions & 0 deletions src/icalendar/tests/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@ def test_timezones_to_ical_is_inverse_of_from_ical(timezones, timezone_file):
timezone = getattr(timezones, timezone_file)
assert timezone.to_ical() == timezone.raw_ics

def test_description_parsed_properly_issue_53(events):
'''Issue #53 - Parsing failure on some descriptions?
https://github.com/collective/icalendar/issues/53
'''
assert b'July 12 at 6:30 PM' in events.issue_53_description_parsed_properly['DESCRIPTION'].to_ical()

def test_tzid_parsed_properly_issue_53(timezones):
'''Issue #53 - Parsing failure on some descriptions?
https://github.com/collective/icalendar/issues/53
'''
assert timezones.issue_53_tzid_parsed_properly['tzid'].to_ical() == b'America/New_York'
19 changes: 19 additions & 0 deletions src/icalendar/tests/timezones/issue_53_tzid_parsed_properly.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
BEGIN:VTIMEZONE
TZID:America/New_York
TZURL:http://tzurl.org/zoneinfo-outlook/America/New_York
X-LIC-LOCATION:America/New_York
BEGIN:DAYLIGHT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE

0 comments on commit 54cfb78

Please sign in to comment.