summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-022-utils.py
blob: ad65aeab9c88971a565dc560f505f572376cf21c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()