diff options
-rw-r--r-- | tests/test-001-contact_reference.py | 9 | ||||
-rw-r--r-- | tests/test-002-attendee.py | 9 | ||||
-rw-r--r-- | tests/test-003-event.py | 9 |
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/test-001-contact_reference.py b/tests/test-001-contact_reference.py index 81ce3b5..c80d139 100644 --- a/tests/test-001-contact_reference.py +++ b/tests/test-001-contact_reference.py @@ -6,6 +6,15 @@ from pykolab.xml import ContactReference class TestEventXML(unittest.TestCase): contact_reference = ContactReference("jane@doe.org") + def assertIsInstance(self, _value, _type): + if hasattr(unittest.TestCase, 'assertIsInstance'): + return unittest.TestCase.assertIsInstance(self, _value, _type) + else: + if (type(_value)) == _type: + return True + else: + raise AssertionError, "%s != %s" % (type(_value), _type) + def test_001_minimal(self): self.assertIsInstance(self.contact_reference.__str__(), basestring) diff --git a/tests/test-002-attendee.py b/tests/test-002-attendee.py index 15ce83f..465349a 100644 --- a/tests/test-002-attendee.py +++ b/tests/test-002-attendee.py @@ -6,6 +6,15 @@ from pykolab.xml import Attendee class TestEventXML(unittest.TestCase): attendee = Attendee("jane@doe.org") + def assertIsInstance(self, _value, _type): + if hasattr(unittest.TestCase, 'assertIsInstance'): + return unittest.TestCase.assertIsInstance(self, _value, _type) + else: + if (type(_value)) == _type: + return True + else: + raise AssertionError, "%s != %s" % (type(_value), _type) + def test_001_minimal(self): self.assertIsInstance(self.attendee.__str__(), basestring) diff --git a/tests/test-003-event.py b/tests/test-003-event.py index c18523a..9da4cf6 100644 --- a/tests/test-003-event.py +++ b/tests/test-003-event.py @@ -12,6 +12,15 @@ from pykolab.xml import InvalidEventDateError class TestEventXML(unittest.TestCase): event = Event() + def assertIsInstance(self, _value, _type): + if hasattr(unittest.TestCase, 'assertIsInstance'): + return unittest.TestCase.assertIsInstance(self, _value, _type) + else: + if (type(_value)) == _type: + return True + else: + raise AssertionError, "%s != %s" % (type(_value), _type) + def test_000_no_start_date(self): self.assertRaises(EventIntegrityError, self.event.__str__) |