]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Add a test for a locale with one plural form.
authorJeroen Ruigrok van der Werven <asmodai@in-nomine.org>
Fri, 19 Feb 2010 13:38:24 +0000 (13:38 +0000)
committerJeroen Ruigrok van der Werven <asmodai@in-nomine.org>
Fri, 19 Feb 2010 13:38:24 +0000 (13:38 +0000)
babel/messages/tests/pofile.py

index 57a263114116e6b2cbbfc49d369da824c98ded06..54c6e214ae2c9568a3f4abba28feb1c5f38508e8 100644 (file)
@@ -190,6 +190,16 @@ msgstr "Bahr"
         pofile.write_po(out_buf, catalog, omit_header=True)
         assert out_buf.getvalue().strip() == buf.getvalue().strip(), out_buf.getvalue()
 
+    def test_single_plural_form(self):
+        buf = StringIO(r'''msgid "foo"
+msgid_plural "foo"
+msgstr[0] "Voh"''')
+        catalog = pofile.read_po(buf, locale='ja_JP')
+        self.assertEqual(1, len(catalog))
+        self.assertEqual(1, catalog.num_plurals)
+        message = catalog['foo']
+        self.assertEqual(1, len(message.string))
+
     def test_singular_plural_form(self):
         buf = StringIO(r'''msgid "foo"
 msgid_plural "foo"