Mercurial > babel > mirror
comparison babel/messages/tests/pofile.py @ 445:766ddd5161c8 trunk
More than two plural forms work nowadays. Adjust the test.
author | jruigrok |
---|---|
date | Fri, 19 Feb 2010 14:12:41 +0000 |
parents | a4eb4ea8d6f9 |
children | 458384f70395 |
comparison
equal
deleted
inserted
replaced
444:a4eb4ea8d6f9 | 445:766ddd5161c8 |
---|---|
213 | 213 |
214 def test_more_than_two_plural_forms(self): | 214 def test_more_than_two_plural_forms(self): |
215 buf = StringIO(r'''msgid "foo" | 215 buf = StringIO(r'''msgid "foo" |
216 msgid_plural "foo" | 216 msgid_plural "foo" |
217 msgstr[0] "Voh" | 217 msgstr[0] "Voh" |
218 msgstr[1] "Vohs"''') # last translation form is missing | 218 msgstr[1] "Vohs" |
219 #msgstr[2] "Vohss"''') | 219 msgstr[2] "Vohss"''') |
220 catalog = pofile.read_po(buf, locale='lv_LV') | 220 catalog = pofile.read_po(buf, locale='lv_LV') |
221 self.assertEqual(1, len(catalog)) | 221 self.assertEqual(1, len(catalog)) |
222 self.assertEqual(3, catalog.num_plurals) | 222 self.assertEqual(3, catalog.num_plurals) |
223 message = catalog['foo'] | 223 message = catalog['foo'] |
224 self.assertEqual(3, len(message.string)) | 224 self.assertEqual(3, len(message.string)) |
225 self.assertEqual('', message.string[2]) | 225 self.assertEqual(u'Vohss', message.string[2]) |
226 | 226 |
227 def test_plural_with_square_brackets(self): | 227 def test_plural_with_square_brackets(self): |
228 buf = StringIO(r'''msgid "foo" | 228 buf = StringIO(r'''msgid "foo" |
229 msgid_plural "foo" | 229 msgid_plural "foo" |
230 msgstr[0] "Voh [text]" | 230 msgstr[0] "Voh [text]" |