summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-23 14:00:55 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-23 14:00:55 +0100
commit84992b37c15405a6276ced189a9de185c000a3da (patch)
tree8f62408ac536ad7840e0b8d192bf28e897664b46 /tests
parent8dbdba5cc919cefc5b4ab12f2b2cfeb14b2c4ae1 (diff)
downloadpykolab-84992b37c15405a6276ced189a9de185c000a3da.tar.gz
Rename test files to at least somewhat indicate what each of them is for.
Add tests for contact references
Diffstat (limited to 'tests')
-rw-r--r--tests/test-000-imports.py (renamed from tests/test-000.py)0
-rw-r--r--tests/test-001-contact_reference.py21
-rw-r--r--tests/test-002-attendee.py (renamed from tests/test-001.py)5
-rw-r--r--tests/test-003-event.py (renamed from tests/test-002.py)0
4 files changed, 25 insertions, 1 deletions
diff --git a/tests/test-000.py b/tests/test-000-imports.py
index 17e1c57..17e1c57 100644
--- a/tests/test-000.py
+++ b/tests/test-000-imports.py
diff --git a/tests/test-001-contact_reference.py b/tests/test-001-contact_reference.py
new file mode 100644
index 0000000..81ce3b5
--- /dev/null
+++ b/tests/test-001-contact_reference.py
@@ -0,0 +1,21 @@
+import datetime
+import unittest
+
+from pykolab.xml import ContactReference
+
+class TestEventXML(unittest.TestCase):
+ contact_reference = ContactReference("jane@doe.org")
+
+ def test_001_minimal(self):
+ self.assertIsInstance(self.contact_reference.__str__(), basestring)
+
+ def test_002_empty_name(self):
+ self.assertEqual(self.contact_reference.get_name(), "")
+
+ def test_003_set_name(self):
+ name = "Doe, Jane"
+ self.contact_reference.set_name(name)
+ self.assertEqual(self.contact_reference.get_name(), name)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/test-001.py b/tests/test-002-attendee.py
index 83f1c33..74f680b 100644
--- a/tests/test-001.py
+++ b/tests/test-002-attendee.py
@@ -9,7 +9,10 @@ class TestEventXML(unittest.TestCase):
def test_001_minimal(self):
self.assertIsInstance(self.attendee.__str__(), basestring)
- def test_002_set_name(self):
+ def test_002_empty_name(self):
+ self.assertEqual(self.attendee.get_name(), "")
+
+ def test_003_set_name(self):
name = "Doe, Jane"
self.attendee.set_name(name)
self.assertEqual(self.attendee.get_name(), name)
diff --git a/tests/test-002.py b/tests/test-003-event.py
index 3a6a863..3a6a863 100644
--- a/tests/test-002.py
+++ b/tests/test-003-event.py