summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-015-translate.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test-015-translate.py')
-rw-r--r--tests/unit/test-015-translate.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/test-015-translate.py b/tests/unit/test-015-translate.py
new file mode 100644
index 0000000..8ca9463
--- /dev/null
+++ b/tests/unit/test-015-translate.py
@@ -0,0 +1,25 @@
+import unittest
+import gettext
+from pykolab import translate
+
+class TestTranslate(unittest.TestCase):
+
+ def setUp(self):
+ translate.setUserLanguage('en')
+
+ def test_001_default_langs(self):
+ self.assertTrue(len(translate.getDefaultLangs()) > 0)
+
+ def test_002_translate(self):
+ from pykolab.translate import _
+ self.assertEqual(_("Folder name"), "Folder name")
+
+ def test_003_set_lang(self):
+ from pykolab.translate import _
+ self.assertFalse(translate.setUserLanguage('foo_bar'))
+ self.assertEqual(_("Folder name"), "Folder name")
+ self.assertTrue(translate.setUserLanguage('de_DE'))
+ self.assertEqual(_("Folder name"), "Ordnername")
+
+if __name__ == '__main__':
+ unittest.main()