1 from __future__
import absolute_import
, division
, unicode_literals
5 from cola
.i18n
import N_
6 from cola
.compat
import uchr
9 class ColaI18nTestCase(unittest
.TestCase
):
10 """Test cases for the ColaApplication class"""
15 def test_translates_noun(self
):
16 """Test that strings with @@noun are translated
19 expect
= uchr(0x30B3) + uchr(0x30DF) + uchr(0x30C3) + uchr(0x30C8)
20 actual
= N_('Commit@@verb')
21 self
.assertEqual(expect
, actual
)
23 def test_translates_verb(self
):
24 """Test that strings with @@verb are translated
27 expect
= 'Commit aufnehmen'
28 actual
= N_('Commit@@verb')
29 self
.assertEqual(expect
, actual
)
31 def test_translates_english_noun(self
):
32 """Test that English strings with @@noun are properly handled
34 i18n
.install('en_US.UTF-8')
36 actual
= N_('Commit@@noun')
37 self
.assertEqual(expect
, actual
)
39 def test_translates_english_verb(self
):
40 """Test that English strings with @@verb are properly handled
42 i18n
.install('en_US.UTF-8')
44 actual
= N_('Commit@@verb')
45 self
.assertEqual(expect
, actual
)
47 def test_translates_random_english(self
):
48 """Test that random English strings are passed through as-is
50 i18n
.install('en_US.UTF-8')
53 self
.assertEqual(expect
, actual
)
55 def test_translate_push_pull_french(self
):
59 self
.assertEqual(expect
, actual
)
63 self
.assertEqual(expect
, actual
)
66 if __name__
== '__main__':