summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-003-event.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-02-24 19:52:49 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2014-02-24 20:00:06 +0100
commitf64c8d5e4162ccd034e4ab8fe7a3760b0282d1f0 (patch)
tree70a3b7838884b2cc30be51c13579768ed0ca97d8 /tests/unit/test-003-event.py
parent881f6847bcf45a21ce8ea691d8ede1190393bcc8 (diff)
downloadpykolab-f64c8d5e4162ccd034e4ab8fe7a3760b0282d1f0.tar.gz
Add tests for recent improvements to libkolab event wrapper
Diffstat (limited to 'tests/unit/test-003-event.py')
-rw-r--r--tests/unit/test-003-event.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index 8f76397..1a38fad 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -2,6 +2,7 @@ import datetime
import pytz
import sys
import unittest
+import kolabformat
from pykolab.xml import Attendee
from pykolab.xml import Event
@@ -40,8 +41,8 @@ class TestEventXML(unittest.TestCase):
self.assertIsInstance(self.event.get_attendees(), list)
self.assertEqual(len(self.event.get_attendees()), 1)
- def test_005_attendee_add_name(self):
- self.event.add_attendee("jane@doe.org", "Doe, Jane")
+ def test_005_attendee_add_name_and_props(self):
+ self.event.add_attendee("jane@doe.org", "Doe, Jane", role="OPTIONAL", cutype="RESOURCE")
self.assertIsInstance(self.event.get_attendees(), list)
self.assertEqual(len(self.event.get_attendees()), 2)
@@ -52,6 +53,10 @@ class TestEventXML(unittest.TestCase):
self.assertIsInstance(self.event.get_attendee_by_email("jane@doe.org"), Attendee)
self.assertIsInstance(self.event.get_attendee("jane@doe.org"), Attendee)
+ def test_007_get_attendee_props(self):
+ self.assertEqual(self.event.get_attendee("jane@doe.org").get_cutype(), kolabformat.CutypeResource)
+ self.assertEqual(self.event.get_attendee("jane@doe.org").get_role(), kolabformat.Optional)
+
def test_007_get_nonexistent_attendee_by_email(self):
self.assertRaises(ValueError, self.event.get_attendee_by_email, "nosuchattendee@invalid.domain")
self.assertRaises(ValueError, self.event.get_attendee, "nosuchattendee@invalid.domain")
@@ -77,7 +82,10 @@ class TestEventXML(unittest.TestCase):
self.event.delegate("jane@doe.org", "max@imum.com")
def test_013_delegatee_is_now_attendee(self):
- self.assertIsInstance(self.event.get_attendee("max@imum.com"), Attendee)
+ delegatee = self.event.get_attendee("max@imum.com")
+ self.assertIsInstance(delegatee, Attendee)
+ self.assertEqual(delegatee.get_role(), kolabformat.Optional)
+ self.assertEqual(delegatee.get_cutype(), kolabformat.CutypeResource)
def test_014_delegate_attendee_adds(self):
self.assertEqual(len(self.event.get_attendee("jane@doe.org").get_delegated_to()), 1)