1 from __future__
import absolute_import
, division
, unicode_literals
5 from cola
.i18n
import N_
6 from cola
.compat
import unichr
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
= (unichr(0x30b3) + unichr(0x30df) +
20 unichr(0x30c3) + unichr(0x30c8))
21 actual
= N_('Commit@@verb')
22 self
.assertEqual(expect
, actual
)
24 def test_translates_verb(self
):
25 """Test that strings with @@verb are translated
28 expect
= 'Version aufnehmen'
29 actual
= N_('Commit@@verb')
30 self
.assertEqual(expect
, actual
)
32 def test_translates_english_noun(self
):
33 """Test that English strings with @@noun are properly handled
35 i18n
.install('en_US.UTF-8')
37 actual
= N_('Commit@@noun')
38 self
.assertEqual(expect
, actual
)
40 def test_translates_english_verb(self
):
41 """Test that English strings with @@verb are properly handled
43 i18n
.install('en_US.UTF-8')
45 actual
= N_('Commit@@verb')
46 self
.assertEqual(expect
, actual
)
48 def test_translates_random_english(self
):
49 """Test that random English strings are passed through as-is
51 i18n
.install('en_US.UTF-8')
54 self
.assertEqual(expect
, actual
)
57 if __name__
== '__main__':