comparison 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
comparison
equal deleted inserted replaced
70:620fdd25657a 71:b260ffa01a2d
24 assert catalog.PYTHON_FORMAT('foo %d bar') 24 assert catalog.PYTHON_FORMAT('foo %d bar')
25 assert catalog.PYTHON_FORMAT('foo %s bar') 25 assert catalog.PYTHON_FORMAT('foo %s bar')
26 assert catalog.PYTHON_FORMAT('foo %r bar') 26 assert catalog.PYTHON_FORMAT('foo %r bar')
27 27
28 28
29 class CatalogTestCase(unittest.TestCase):
30
31 def test_two_messages_with_same_singular(self):
32 cat = catalog.Catalog()
33 cat.add('foo')
34 cat.add(('foo', 'foos'))
35 self.assertEqual(1, len(cat))
36
37
29 def suite(): 38 def suite():
30 suite = unittest.TestSuite() 39 suite = unittest.TestSuite()
31 suite.addTest(doctest.DocTestSuite(catalog, optionflags=doctest.ELLIPSIS)) 40 suite.addTest(doctest.DocTestSuite(catalog, optionflags=doctest.ELLIPSIS))
32 suite.addTest(unittest.makeSuite(MessageTestCase)) 41 suite.addTest(unittest.makeSuite(MessageTestCase))
42 suite.addTest(unittest.makeSuite(CatalogTestCase))
33 return suite 43 return suite
34 44
35 if __name__ == '__main__': 45 if __name__ == '__main__':
36 unittest.main(defaultTest='suite') 46 unittest.main(defaultTest='suite')
Copyright (C) 2012-2017 Edgewall Software