test also that property parameters are build from an icalendar string

pull/61/head
Johannes Raggam 2012-08-24 14:31:16 +02:00
rodzic 64ba5ec191
commit 6142289956
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -10,8 +10,12 @@ class TestPropertyParams(unittest.TestCase):
ical.add('organizer', cal_address)
ical_str = icalendar.Calendar.to_ical(ical)
exp_str = """BEGIN:VCALENDAR\r\nORGANIZER;CN="Doe, John":mailto:john.doe@example.org\r\nEND:VCALENDAR\r\n"""
exp_str = """BEGIN:VCALENDAR\r\nORGANIZER;CN="Doe, John":"""\
"""mailto:john.doe@example.org\r\nEND:VCALENDAR\r\n"""
self.assertEqual(ical_str, exp_str)
raise Exception
# other way around: ensure the property parameters can be restored from
# an icalendar string.
ical2 = icalendar.Calendar.from_ical(ical_str)
self.assertEqual(ical2.get('ORGANIZER').params.get('CN'), 'Doe, John')