# HG changeset patch # User jruigrok # Date 1266586704 0 # Node ID 53fe6880791a59dd25995378b05e7def89ac1d97 # Parent af7b13202b1194b6bc12f8069c68b7bc0a28775e Add a test for a locale with one plural form. diff --git a/babel/messages/tests/pofile.py b/babel/messages/tests/pofile.py --- a/babel/messages/tests/pofile.py +++ b/babel/messages/tests/pofile.py @@ -190,6 +190,16 @@ 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"