diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-07-13 14:56:45 +0100 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-07-13 14:56:45 +0100 |
commit | 53b5d85dda5f956892a0074863d965d4c14a96fe (patch) | |
tree | 525734568cdac3a1ca1f864020d579b2090dd2ac | |
parent | b7fda1267f8b9d85601b7a283b59ff54c8b671d4 (diff) | |
download | pykolab-53b5d85dda5f956892a0074863d965d4c14a96fe.tar.gz |
Attempt to fix running tests on target platforms
-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__) |