summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-003-event.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-12-28 13:17:34 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-12-28 13:17:34 +0100
commitf3ff7b73f7419a591a4f8bc770dd3f8b01ef19e5 (patch)
tree7e47ec57aa1c34789f18f1ea7cb337344959a6a7 /tests/unit/test-003-event.py
parent7c4b36524e4ce2a3a035624de0e67cdbf566c0a8 (diff)
downloadpykolab-f3ff7b73f7419a591a4f8bc770dd3f8b01ef19e5.tar.gz
Add _msg parameter to assertIsInstance()
Correct newline termination
Diffstat (limited to 'tests/unit/test-003-event.py')
-rw-r--r--tests/unit/test-003-event.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index 4e14cd4..cfb0eb6 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -346,14 +346,17 @@ class TestEventXML(unittest.TestCase):
# set language to default
pykolab.translate.setUserLanguage('en_US')
- def assertIsInstance(self, _value, _type):
+ def assertIsInstance(self, _value, _type, _msg=None):
if hasattr(unittest.TestCase, 'assertIsInstance'):
- return unittest.TestCase.assertIsInstance(self, _value, _type)
+ return unittest.TestCase.assertIsInstance(self, _value, _type, _msg)
else:
if (type(_value)) == _type:
return True
else:
- raise AssertionError, "%s != %s" % (type(_value), _type)
+ if not _msg == None:
+ raise AssertionError, "%s != %s: %r" % (type(_value), _type, _msg)
+ else:
+ raise AssertionError, "%s != %s" % (type(_value), _type)
def test_000_no_start_date(self):
self.assertRaises(EventIntegrityError, self.event.__str__)
@@ -839,7 +842,7 @@ END:VEVENT
self.assertEqual(parts[3]['Content-ID'].strip('<>'), attachments[0].uri()[4:])
self.assertEqual(parts[4].get_content_type(), 'text/plain')
self.assertEqual(parts[4]['Content-ID'].strip('<>'), attachments[1].uri()[4:])
- self.assertEqual(event.get_attachment_data(1), 'This is a text file')
+ self.assertEqual(event.get_attachment_data(1), 'This is a text file\n')
def test_024_bogus_itip_data(self):
# DTSTAMP contains an invalid date/time value