summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-002-attendee.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-07-23 08:23:49 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-07-23 08:23:49 -0400
commit524849338fcb0cb40bcdb18f4dbe7e9660074f20 (patch)
treeaabf60b524121b08a32680d0e917c92e8fec8276 /tests/unit/test-002-attendee.py
parentb3e6648328dd00dd53e60633b23a40ed6ff578e5 (diff)
downloadpykolab-524849338fcb0cb40bcdb18f4dbe7e9660074f20.tar.gz
Add methods to dump Kolab XML objects as dict()
Diffstat (limited to 'tests/unit/test-002-attendee.py')
-rw-r--r--tests/unit/test-002-attendee.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/test-002-attendee.py b/tests/unit/test-002-attendee.py
index 8bcee3c..d7584e3 100644
--- a/tests/unit/test-002-attendee.py
+++ b/tests/unit/test-002-attendee.py
@@ -108,5 +108,25 @@ class TestEventXML(unittest.TestCase):
self.assertEqual(participant_status_label(kolabformat.PartTentative), "Tentatively Accepted")
self.assertEqual(participant_status_label('UNKNOWN'), "UNKNOWN")
+ def test_020_to_dict(self):
+ name = "Doe, Jane"
+ role = 'OPT-PARTICIPANT'
+ cutype = 'RESOURCE'
+ partstat = 'ACCEPTED'
+ self.attendee.set_name(name)
+ self.attendee.set_rsvp(True)
+ self.attendee.set_role(role)
+ self.attendee.set_cutype(cutype)
+ self.attendee.set_participant_status(partstat)
+
+ data = self.attendee.to_dict()
+ self.assertIsInstance(data, dict)
+ self.assertEqual(data['role'], role)
+ self.assertEqual(data['cutype'], cutype)
+ self.assertEqual(data['partstat'], partstat)
+ self.assertEqual(data['name'], name)
+ self.assertEqual(data['email'], 'jane@doe.org')
+ self.assertTrue(data['rsvp'])
+
if __name__ == '__main__':
unittest.main()