for git v1.5.2 (and below): chdir to the directory of the target file before executin...
[translate_toolkit.git] / lang / test_am.py
bloba85c7d2cd16e6940124969a4ca917ff3ae1f7ca2
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 from translate.lang import factory
6 def test_punctranslate():
7 """Tests that we can translate punctuation."""
8 language = factory.getlanguage('am')
9 assert language.punctranslate(u"abc efg") == u"abc efg"
10 assert language.punctranslate(u"abc efg.") == u"abc efg።"
11 assert language.punctranslate(u"abc efg. hij.") == u"abc efg። hij።"
12 assert language.punctranslate(u"abc efg, hij;") == u"abc efg፣ hij፤"
13 assert language.punctranslate(u"Delete file: %s?") == u"Delete file: %s?"
15 def test_sentences():
16 """Tests basic functionality of sentence segmentation."""
17 language = factory.getlanguage('am')
18 sentences = language.sentences(u"ለምልክቱ መግቢያ የተለየ መለያ። ይህ የሚጠቅመው የታሪኩን ዝርዝር ለማስቀመጥ ነው።")
19 print sentences
20 assert sentences == [u"ለምልክቱ መግቢያ የተለየ መለያ።", u"ይህ የሚጠቅመው የታሪኩን ዝርዝር ለማስቀመጥ ነው።"]