summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-02-08 16:17:36 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-02-08 16:17:36 +0000
commit8565c4c13d454819550744672e566bac6714f6c3 (patch)
tree6113ed642f17eb91814ee61dfea4da11d4455c57 /tests
parent6c82952f1f737e619d7ef95c0308a83336fa1ce1 (diff)
downloadpykolab-8565c4c13d454819550744672e566bac6714f6c3.tar.gz
Add tests for transliteration of ru_RU using the new transliterate() function fallback for utils.translate()
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test-010-transliterate.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/unit/test-010-transliterate.py b/tests/unit/test-010-transliterate.py
index 7f70700..3c98a1a 100644
--- a/tests/unit/test-010-transliterate.py
+++ b/tests/unit/test-010-transliterate.py
@@ -59,6 +59,45 @@ class TestTransliteration(unittest.TestCase):
self.assertEqual('Alvaro', utils.translate(givenname, preferredlanguage))
self.assertEqual('Fuentes', utils.translate(surname, preferredlanguage))
+ def test_005_raw_ru_RU(self):
+ from pykolab import utils
+ givenname = r'Николай'
+ surname = r'Римский-Корсаков'
+
+ preferredlanguage = 'ru_RU'
+
+ self.assertEqual('Nikolaj', utils.translate(givenname, preferredlanguage))
+ self.assertEqual('Rimskij-Korsakov', utils.translate(surname, preferredlanguage))
+
+ def test_006_unicode_ru_RU(self):
+ from pykolab import utils
+ givenname = u'Николай'
+ surname = u'Римский-Корсаков'
+
+ preferredlanguage = 'ru_RU'
+
+ self.assertEqual('Nikolaj', utils.translate(givenname, preferredlanguage))
+ self.assertEqual('Rimskij-Korsakov', utils.translate(surname, preferredlanguage))
+
+ def test_007_raw_ru_RU(self):
+ from pykolab import utils
+ givenname = r'Юлия'
+ surname = r'Ёлкина'
+
+ preferredlanguage = 'ru_RU'
+
+ self.assertEqual('Yuliya', utils.translate(givenname, preferredlanguage))
+ self.assertEqual('Yolkina', utils.translate(surname, preferredlanguage))
+
+ def test_008_unicode_ru_RU(self):
+ from pykolab import utils
+ givenname = u'Юлия'
+ surname = u'Ёлкина'
+
+ preferredlanguage = 'ru_RU'
+
+ self.assertEqual('Yuliya', utils.translate(givenname, preferredlanguage))
+ self.assertEqual('Yolkina', utils.translate(surname, preferredlanguage))
if __name__ == '__main__':
unittest.main()