summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-030-recipientpolicy.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test-030-recipientpolicy.py')
-rw-r--r--tests/unit/test-030-recipientpolicy.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/test-030-recipientpolicy.py b/tests/unit/test-030-recipientpolicy.py
new file mode 100644
index 0000000..0f50747
--- /dev/null
+++ b/tests/unit/test-030-recipientpolicy.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+
+from pykolab.plugins.recipientpolicy import KolabRecipientpolicy
+
+policy = KolabRecipientpolicy()
+
+
+class TestRecipientPolicy(unittest.TestCase):
+ def test_001_primary_mail(self):
+ """
+ The spaces in attributes used for mail generation.
+ """
+
+ entry = {
+ 'surname': ' sn ',
+ 'givenname': ' gn ',
+ }
+
+ mail = policy.set_primary_mail(
+ primary_mail='%(givenname)s.%(surname)s@%(domain)s',
+ primary_domain='example.org',
+ entry=entry
+ )
+
+ self.assertEqual('gn.sn@example.org', mail)
+
+if __name__ == '__main__':
+ unittest.main()