summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-022-utils.py
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-05-13 10:45:50 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-05-13 10:45:50 +0200
commit3e419b753a2844655362c824cff167583d604bfa (patch)
tree09347856040f92bcce81b3f31d1cc4746a789711 /tests/unit/test-022-utils.py
parent39e31385df84f1d46576ecc8461ab1d0177de1e7 (diff)
downloadpykolab-3e419b753a2844655362c824cff167583d604bfa.tar.gz
Trim spaces in surname/givenname/sn when generating mail/alias (#5360)
Reviewers: vanmeeuwen, #pykolab_developers Reviewed By: vanmeeuwen, #pykolab_developers Subscribers: vanmeeuwen Differential Revision: https://git.kolab.org/D136
Diffstat (limited to 'tests/unit/test-022-utils.py')
-rw-r--r--tests/unit/test-022-utils.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/test-022-utils.py b/tests/unit/test-022-utils.py
new file mode 100644
index 0000000..ad65aea
--- /dev/null
+++ b/tests/unit/test-022-utils.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+
+from pykolab import utils
+
+
+class TestTranslate(unittest.TestCase):
+
+ def test_001_normalize(self):
+ attr = {"test1": " trim ", "test2": [" trim1 ", " trim2 "]}
+ result = utils.normalize(attr)
+
+ self.assertEqual(result['test1'], "trim")
+ self.assertEqual(result['test2'][0], "trim1")
+ self.assertEqual(result['test2'][1], "trim2")
+
+
+if __name__ == '__main__':
+ unittest.main()