Merge pull request #413 from jacadzaca/test_restructure_issue_168

restructure issue 168
pull/417/head^2
Jaca 2022-10-03 19:00:10 +02:00 zatwierdzone przez GitHub
commit f17470817a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 25 dodań i 23 usunięć

Wyświetl plik

@ -0,0 +1,7 @@
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20150905T090000Z
DTEND:20150905T100000Z
UID:123
END:VEVENT
END:VCALENDAR

Wyświetl plik

@ -0,0 +1,8 @@
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20150905T090000Z
DTEND:20150905T100000Z
UID:123
X-APPLE-RADIUS=49.91307046514149
END:VEVENT
END:VCALENDAR

Wyświetl plik

@ -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

Wyświetl plik

@ -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