Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test restructure - test_issue_53 #402

Merged
merged 3 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
21 changes: 0 additions & 21 deletions src/icalendar/tests/test_fixed_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +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_55(self):
"""Issue #55 - Parse error on utc-offset with seconds value
https://github.com/collective/icalendar/issues/55
Expand Down
13 changes: 13 additions & 0 deletions src/icalendar/tests/test_parsing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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