diff babel/messages/tests/catalog.py @ 71:b260ffa01a2d

Message catalogs can have multiple messages with the same ID, where some of them have plural strings, and others don't. Still the same message.
author cmlenz
date Fri, 08 Jun 2007 16:16:08 +0000
parents 1d8e81bfedf9
children f421e5576d26
line wrap: on
line diff
--- a/babel/messages/tests/catalog.py
+++ b/babel/messages/tests/catalog.py
@@ -26,10 +26,20 @@
         assert catalog.PYTHON_FORMAT('foo %r bar')
 
 
+class CatalogTestCase(unittest.TestCase):
+
+    def test_two_messages_with_same_singular(self):
+        cat = catalog.Catalog()
+        cat.add('foo')
+        cat.add(('foo', 'foos'))
+        self.assertEqual(1, len(cat))
+
+
 def suite():
     suite = unittest.TestSuite()
     suite.addTest(doctest.DocTestSuite(catalog, optionflags=doctest.ELLIPSIS))
     suite.addTest(unittest.makeSuite(MessageTestCase))
+    suite.addTest(unittest.makeSuite(CatalogTestCase))
     return suite
 
 if __name__ == '__main__':
Copyright (C) 2012-2017 Edgewall Software