kopia lustrzana https://github.com/collective/icalendar
Merge pull request #413 from jacadzaca/test_restructure_issue_168
restructure issue 168pull/417/head^2
commit
f17470817a
|
|
@ -0,0 +1,7 @@
|
|||
BEGIN:VCALENDAR
|
||||
BEGIN:VEVENT
|
||||
DTSTART:20150905T090000Z
|
||||
DTEND:20150905T100000Z
|
||||
UID:123
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
BEGIN:VCALENDAR
|
||||
BEGIN:VEVENT
|
||||
DTSTART:20150905T090000Z
|
||||
DTEND:20150905T100000Z
|
||||
UID:123
|
||||
X-APPLE-RADIUS=49.91307046514149
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
|
|
@ -61,29 +61,6 @@ class TestIssues(unittest.TestCase):
|
|||
icalendar.Event.from_ical(event.to_ical()).to_ical()
|
||||
)
|
||||
|
||||
def test_issue_168(self):
|
||||
"""Issue #168 - Parsing invalid icalendars fails without any warning
|
||||
https://github.com/collective/icalendar/issues/168
|
||||
"""
|
||||
|
||||
event_str = """
|
||||
BEGIN:VCALENDAR
|
||||
BEGIN:VEVENT
|
||||
DTEND:20150905T100000Z
|
||||
DTSTART:20150905T090000Z
|
||||
X-APPLE-RADIUS=49.91307046514149
|
||||
UID:123
|
||||
END:VEVENT
|
||||
END:VCALENDAR"""
|
||||
|
||||
calendar = icalendar.Calendar.from_ical(event_str)
|
||||
self.assertEqual(
|
||||
calendar.to_ical(),
|
||||
b'BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20150905T090000Z\r\n'
|
||||
b'DTEND:20150905T100000Z\r\nUID:123\r\n'
|
||||
b'END:VEVENT\r\nEND:VCALENDAR\r\n'
|
||||
)
|
||||
|
||||
def test_issue_178(self):
|
||||
"""Issue #178 - A component with an unknown/invalid name is represented
|
||||
as one of the known components, the information about the original
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
'''Issue #168 - Parsing invalid icalendars fails without any warning
|
||||
|
||||
https://github.com/collective/icalendar/issues/168
|
||||
'''
|
||||
from icalendar import Calendar
|
||||
|
||||
def test_issue_168_parsing_inavlid_calendars_no_warning(calendars):
|
||||
expected_error = (None, "Content line could not be parsed into parts: 'X-APPLE-RADIUS=49.91307046514149': X-APPLE-RADIUS=49.91307046514149")
|
||||
assert expected_error in calendars.issue_168_input.walk('VEVENT')[0].errors
|
||||
assert calendars.issue_168_input.to_ical() == calendars.issue_168_expected_output.raw_ics
|
||||
Ładowanie…
Reference in New Issue