Raise explicit error on another malformed content line case. fixes #115, fixes #114

pull/120/merge
Johannes Raggam 2013-12-25 20:47:08 +01:00
rodzic a2600b467f
commit 0c05b7daab
2 zmienionych plików z 15 dodań i 0 usunięć

Wyświetl plik

@ -5,6 +5,9 @@ Changelog
4.0.dev (unreleased)
--------------------
- Raise explicit error on another malformed content line case.
[hajdbo]
- Correctly parse datetime component property values with timezone information
when parsed from ical strings.
[untitaker]

Wyświetl plik

@ -177,3 +177,15 @@ END:VCALENDAR"""
cal = icalendar.Calendar.from_ical(ical_str)
org_cn = cal.walk('VEVENT')[0]['ORGANIZER'].params['CN']
self.assertEqual(org_cn, u'acme, ädmin')
def test_issue_114(self):
"""Issue #114/#115 - invalid line in event breaks the parser
https://github.com/collective/icalendar/issues/114
"""
directory = os.path.dirname(__file__)
ics = open(os.path.join(directory, 'case_invalid_line.ics'), 'rb')
with self.assertRaises(ValueError):
cal = icalendar.Calendar.from_ical(ics.read())
cal # pep 8
ics.close()