# HG changeset patch # User jruigrok # Date 1266586704 0 # Node ID 3474ffd631e6cf9067072778c0aca5a8af9fa7bd # Parent 865b13853345c1242582519f39102de786999e78 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"