summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-002-attendee.py
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-05-04 15:53:48 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-05-04 15:53:48 +0200
commitc204eaaa2c9a006432fe00489a352833143db01d (patch)
tree18860f2e335b9a98d34f404d5c4b81d22f2ce222 /tests/unit/test-002-attendee.py
parent4a24e0cc403321713ee1201ade9d36956da1c060 (diff)
downloadpykolab-c204eaaa2c9a006432fe00489a352833143db01d.tar.gz
CS fixes according to PEP8 (ignored mostly line-length errors only)
Summary: . Reviewers: #pykolab_developers Differential Revision: https://git.kolab.org/D134
Diffstat (limited to 'tests/unit/test-002-attendee.py')
-rw-r--r--tests/unit/test-002-attendee.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/tests/unit/test-002-attendee.py b/tests/unit/test-002-attendee.py
index ccde3ac..c90c48e 100644
--- a/tests/unit/test-002-attendee.py
+++ b/tests/unit/test-002-attendee.py
@@ -5,6 +5,7 @@ import kolabformat
from pykolab.xml import Attendee
from pykolab.xml import participant_status_label
+
class TestEventXML(unittest.TestCase):
attendee = Attendee("jane@doe.org")
@@ -15,7 +16,7 @@ class TestEventXML(unittest.TestCase):
if (type(_value)) == _type:
return True
else:
- raise AssertionError, "%s != %s" % (type(_value), _type)
+ raise AssertionError("%s != %s" % (type(_value), _type))
def test_001_minimal(self):
self.assertIsInstance(self.attendee.__str__(), str)
@@ -46,13 +47,13 @@ class TestEventXML(unittest.TestCase):
def test_007_participant_status_map_reverse_lookup(self):
# Reverse lookups
- self.assertEqual([k for k,v in self.attendee.participant_status_map.iteritems() if v == 0][0], "NEEDS-ACTION")
- self.assertEqual([k for k,v in self.attendee.participant_status_map.iteritems() if v == 1][0], "ACCEPTED")
- self.assertEqual([k for k,v in self.attendee.participant_status_map.iteritems() if v == 2][0], "DECLINED")
- self.assertEqual([k for k,v in self.attendee.participant_status_map.iteritems() if v == 3][0], "TENTATIVE")
- self.assertEqual([k for k,v in self.attendee.participant_status_map.iteritems() if v == 4][0], "DELEGATED")
- self.assertEqual([k for k,v in self.attendee.participant_status_map.iteritems() if v == 5][0], "IN-PROCESS")
- self.assertEqual([k for k,v in self.attendee.participant_status_map.iteritems() if v == 6][0], "COMPLETED")
+ self.assertEqual([k for k, v in self.attendee.participant_status_map.iteritems() if v == 0][0], "NEEDS-ACTION")
+ self.assertEqual([k for k, v in self.attendee.participant_status_map.iteritems() if v == 1][0], "ACCEPTED")
+ self.assertEqual([k for k, v in self.attendee.participant_status_map.iteritems() if v == 2][0], "DECLINED")
+ self.assertEqual([k for k, v in self.attendee.participant_status_map.iteritems() if v == 3][0], "TENTATIVE")
+ self.assertEqual([k for k, v in self.attendee.participant_status_map.iteritems() if v == 4][0], "DELEGATED")
+ self.assertEqual([k for k, v in self.attendee.participant_status_map.iteritems() if v == 5][0], "IN-PROCESS")
+ self.assertEqual([k for k, v in self.attendee.participant_status_map.iteritems() if v == 6][0], "COMPLETED")
def test_008_default_rsvp(self):
self.assertEqual(self.attendee.get_rsvp(), 0)
@@ -69,12 +70,12 @@ class TestEventXML(unittest.TestCase):
self.assertEqual(self.attendee.rsvp_map["FALSE"], 0)
def test_012_rsvp_map_reverse_lookup_boolean(self):
- self.assertEqual([k for k,v in self.attendee.rsvp_map.iteritems() if v == True][0], "TRUE")
- self.assertEqual([k for k,v in self.attendee.rsvp_map.iteritems() if v == False][0], "FALSE")
+ self.assertEqual([k for k, v in self.attendee.rsvp_map.iteritems() if v is True][0], "TRUE")
+ self.assertEqual([k for k, v in self.attendee.rsvp_map.iteritems() if v is False][0], "FALSE")
def test_013_rsvp_map_reverse_lookup_integer(self):
- self.assertEqual([k for k,v in self.attendee.rsvp_map.iteritems() if v == 1][0], "TRUE")
- self.assertEqual([k for k,v in self.attendee.rsvp_map.iteritems() if v == 0][0], "FALSE")
+ self.assertEqual([k for k, v in self.attendee.rsvp_map.iteritems() if v == 1][0], "TRUE")
+ self.assertEqual([k for k, v in self.attendee.rsvp_map.iteritems() if v == 0][0], "FALSE")
def test_014_default_role(self):
self.assertEqual(self.attendee.get_role(), 0)
@@ -89,10 +90,10 @@ class TestEventXML(unittest.TestCase):
self.assertEqual(self.attendee.role_map["NON-PARTICIPANT"], 3)
def test_017_role_map_reverse_lookup(self):
- self.assertEqual([k for k,v in self.attendee.role_map.iteritems() if v == 0][0], "REQ-PARTICIPANT")
- self.assertEqual([k for k,v in self.attendee.role_map.iteritems() if v == 1][0], "CHAIR")
- self.assertEqual([k for k,v in self.attendee.role_map.iteritems() if v == 2][0], "OPT-PARTICIPANT")
- self.assertEqual([k for k,v in self.attendee.role_map.iteritems() if v == 3][0], "NON-PARTICIPANT")
+ self.assertEqual([k for k, v in self.attendee.role_map.iteritems() if v == 0][0], "REQ-PARTICIPANT")
+ self.assertEqual([k for k, v in self.attendee.role_map.iteritems() if v == 1][0], "CHAIR")
+ self.assertEqual([k for k, v in self.attendee.role_map.iteritems() if v == 2][0], "OPT-PARTICIPANT")
+ self.assertEqual([k for k, v in self.attendee.role_map.iteritems() if v == 3][0], "NON-PARTICIPANT")
def test_015_cutype_map_length(self):
self.assertEqual(len(self.attendee.cutype_map.keys()), 3)
@@ -103,9 +104,9 @@ class TestEventXML(unittest.TestCase):
self.assertEqual(self.attendee.cutype_map["RESOURCE"], 3)
def test_017_cutype_map_reverse_lookup(self):
- self.assertEqual([k for k,v in self.attendee.cutype_map.iteritems() if v == 1][0], "GROUP")
- self.assertEqual([k for k,v in self.attendee.cutype_map.iteritems() if v == 2][0], "INDIVIDUAL")
- self.assertEqual([k for k,v in self.attendee.cutype_map.iteritems() if v == 3][0], "RESOURCE")
+ self.assertEqual([k for k, v in self.attendee.cutype_map.iteritems() if v == 1][0], "GROUP")
+ self.assertEqual([k for k, v in self.attendee.cutype_map.iteritems() if v == 2][0], "INDIVIDUAL")
+ self.assertEqual([k for k, v in self.attendee.cutype_map.iteritems() if v == 3][0], "RESOURCE")
def test_018_partstat_label(self):
self.assertEqual(participant_status_label('NEEDS-ACTION'), "Needs Action")