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:46:00 +0200
commit284dab73ba7b3be17d3c073e807ef42c8a3462e5 (patch)
tree9628433072821e555904b2724b9cb960285d6bf6 /tests/unit/test-022-utils.py
parent7c9eed0e662d8dc7f2e1996af631457a307a8a7a (diff)
downloadpykolab-284dab73ba7b3be17d3c073e807ef42c8a3462e5.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()