summaryrefslogtreecommitdiffstats
path: root/tests/functional/test_kolabd/test_003_two_johns.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/test_kolabd/test_003_two_johns.py')
-rw-r--r--tests/functional/test_kolabd/test_003_two_johns.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/functional/test_kolabd/test_003_two_johns.py b/tests/functional/test_kolabd/test_003_two_johns.py
new file mode 100644
index 0000000..b2bfb46
--- /dev/null
+++ b/tests/functional/test_kolabd/test_003_two_johns.py
@@ -0,0 +1,51 @@
+import time
+import unittest
+
+import pykolab
+from pykolab import wap_client
+from pykolab.auth import Auth
+from pykolab.imap import IMAP
+
+conf = pykolab.getConf()
+
+class TestKolabDaemon(unittest.TestCase):
+ @classmethod
+ def setup_class(self, *args, **kw):
+ from tests.functional.purge_users import purge_users
+ purge_users()
+
+ @classmethod
+ def teardown_class(self, *args, **kw):
+ from tests.functional.purge_users import purge_users
+ purge_users()
+
+ def test_001_two_johns(self):
+ from tests.functional.user_add import user_add
+ user_add("John", "Doe")
+ user_add("John", "Doe")
+
+ time.sleep(3)
+
+ auth = Auth()
+ auth.connect()
+
+ max_tries = 20
+ while max_tries > 0:
+ recipient1 = auth.find_recipient('john.doe@example.org')
+ recipient2 = auth.find_recipient('john.doe2@example.org')
+
+ if not recipient1 or not recipient2:
+ time.sleep(1)
+ max_tries -= 1
+ else:
+ break
+
+ imap = IMAP()
+ imap.connect()
+
+ folders = imap.lm('user/john.doe@example.org')
+ self.assertEqual(len(folders), 1, "No INBOX found for first John")
+
+ folders = imap.lm('user/john.doe2@example.org')
+ self.assertEqual(len(folders), 1, "No INBOX found for second John")
+