changeset 379:de824f875d99

Use item access to catalog messages in tests, so that they can be easily ported back to the 0.9.x branch.
author cmlenz
date Tue, 08 Jul 2008 20:50:07 +0000
parents 7714ea8e36c7
children 964632b0079d
files babel/messages/tests/pofile.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/babel/messages/tests/pofile.py
+++ b/babel/messages/tests/pofile.py
@@ -171,7 +171,7 @@
         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 @@
         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 @@
 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()
Copyright (C) 2012-2017 Edgewall Software