summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-003-event.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-06 17:31:48 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-06 17:31:48 -0400
commitebd0139376458fec75aa4dc0e7eeeb734dca5aef (patch)
treebbc5d56279a7343c5524878c0daf9f76be5204be /tests/unit/test-003-event.py
parent389a93cb32fd319309aaf95979a7dcaf0070234f (diff)
downloadpykolab-ebd0139376458fec75aa4dc0e7eeeb734dca5aef.tar.gz
Fix laading attendees from XML; add tests for it
Diffstat (limited to 'tests/unit/test-003-event.py')
-rw-r--r--tests/unit/test-003-event.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index fa5d0fe..d9e05fa 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -160,13 +160,15 @@ xml_event = """
<partstat><text>ACCEPTED</text></partstat>
<role><text>REQ-PARTICIPANT</text></role>
<rsvp><boolean>true</boolean></rsvp>
+ <delegated-from><cal-address>mailto:%3Csomebody%40else.com%3E</cal-address></delegated-from>
</parameters>
<cal-address>mailto:%3Cjane%40example.org%3E</cal-address>
</attendee>
<attendee>
<parameters>
- <partstat><text>TENTATIVE</text></partstat>
- <role><text>OPT-PARTICIPANT</text></role>
+ <partstat><text>DELEGATED</text></partstat>
+ <role><text>NON-PARTICIPANT</text></role>
+ <delegated-to><cal-address>mailto:%3Cjane%40example.org%3E</cal-address></delegated-to>
</parameters>
<cal-address>mailto:%3Csomebody%40else.com%3E</cal-address>
</attendee>
@@ -527,6 +529,8 @@ END:VEVENT
event = event_from_string(xml_event)
self.assertEqual(event.uid, '75c740bb-b3c6-442c-8021-ecbaeb0a025e')
self.assertEqual(event.get_attendee_by_email("jane@example.org").get_participant_status(), kolabformat.PartAccepted)
+ self.assertEqual(len(event.get_attendee_by_email("jane@example.org").get_delegated_from()), 1)
+ self.assertEqual(len(event.get_attendee_by_email("somebody@else.com").get_delegated_to()), 1)
self.assertEqual(event.get_sequence(), 1)
self.assertIsInstance(event.get_start(), datetime.datetime)
self.assertEqual(str(event.get_start()), "2014-08-13 10:00:00+00:00")