Mercurial > babel > mirror
comparison babel/messages/tests/pofile.py @ 443:53fe6880791a trunk
Add a test for a locale with one plural form.
author | jruigrok |
---|---|
date | Fri, 19 Feb 2010 13:38:24 +0000 |
parents | af7b13202b11 |
children | a4eb4ea8d6f9 |
comparison
equal
deleted
inserted
replaced
442:af7b13202b11 | 443:53fe6880791a |
---|---|
187 | 187 |
188 # And verify it pass through write_po | 188 # And verify it pass through write_po |
189 out_buf = StringIO() | 189 out_buf = StringIO() |
190 pofile.write_po(out_buf, catalog, omit_header=True) | 190 pofile.write_po(out_buf, catalog, omit_header=True) |
191 assert out_buf.getvalue().strip() == buf.getvalue().strip(), out_buf.getvalue() | 191 assert out_buf.getvalue().strip() == buf.getvalue().strip(), out_buf.getvalue() |
192 | |
193 def test_single_plural_form(self): | |
194 buf = StringIO(r'''msgid "foo" | |
195 msgid_plural "foo" | |
196 msgstr[0] "Voh"''') | |
197 catalog = pofile.read_po(buf, locale='ja_JP') | |
198 self.assertEqual(1, len(catalog)) | |
199 self.assertEqual(1, catalog.num_plurals) | |
200 message = catalog['foo'] | |
201 self.assertEqual(1, len(message.string)) | |
192 | 202 |
193 def test_singular_plural_form(self): | 203 def test_singular_plural_form(self): |
194 buf = StringIO(r'''msgid "foo" | 204 buf = StringIO(r'''msgid "foo" |
195 msgid_plural "foo" | 205 msgid_plural "foo" |
196 msgstr[0] "Voh" | 206 msgstr[0] "Voh" |