From: Christopher Lenz Date: Tue, 8 Jul 2008 20:50:07 +0000 (+0000) Subject: Use item access to catalog messages in tests, so that they can be easily ported back... X-Git-Tag: 1.0~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b940737634cbd34080d7306c40a7b6a4e06ead3;p=thirdparty%2Fbabel.git Use item access to catalog messages in tests, so that they can be easily ported back to the 0.9.x branch. --- diff --git a/babel/messages/tests/pofile.py b/babel/messages/tests/pofile.py index 3e3a2c7e..7e245760 100644 --- a/babel/messages/tests/pofile.py +++ b/babel/messages/tests/pofile.py @@ -171,7 +171,7 @@ msgstr[1] "Vohs"''') # This is a bad po, ja_JP only uses msgstr[0] catalog = pofile.read_po(buf, locale='ja_JP') self.assertEqual(1, len(catalog)) self.assertEqual(1, catalog.num_plurals) - message = catalog.get('foo') + message = catalog['foo'] self.assertEqual(1, len(message.string)) def test_more_than_two_plural_forms(self): @@ -183,7 +183,7 @@ msgstr[1] "Vohs"''') # last translation form is missing catalog = pofile.read_po(buf, locale='lv_LV') self.assertEqual(1, len(catalog)) self.assertEqual(3, catalog.num_plurals) - message = catalog.get('foo') + message = catalog['foo'] self.assertEqual(3, len(message.string)) self.assertEqual('', message.string[2]) @@ -414,8 +414,8 @@ msgstr "" msgid "broken line number" msgstr ""''') catalog = pofile.read_po(buf) - self.assertEqual(catalog.get('missing line number').locations, []) - self.assertEqual(catalog.get('broken line number').locations, []) + self.assertEqual(catalog['missing line number'].locations, []) + self.assertEqual(catalog['broken line number'].locations, []) def suite(): suite = unittest.TestSuite()