diff babel/messages/tests/catalog.py @ 56:27fba894d3ca

Add actual data structures for handling message catalogs, so that more code can be reused here between the frontends.
author cmlenz
date Fri, 08 Jun 2007 11:08:03 +0000
parents
children 5496b9127a07
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/babel/messages/tests/catalog.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2007 Edgewall Software
+# All rights reserved.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://babel.edgewall.org/wiki/License.
+#
+# This software consists of voluntary contributions made by many
+# individuals. For the exact contribution history, see the revision
+# history and logs, available at http://babel.edgewall.org/log/.
+
+import doctest
+from StringIO import StringIO
+import unittest
+
+from babel.messages import catalog
+
+
+class MessageTestCase(unittest.TestCase):
+
+    def test_python_format(self):
+        assert catalog.PYTHON_FORMAT('foo %d bar')
+        assert catalog.PYTHON_FORMAT('foo %s bar')
+        assert catalog.PYTHON_FORMAT('foo %r bar')
+
+
+def suite():
+    suite = unittest.TestSuite()
+    suite.addTest(doctest.DocTestSuite(catalog))
+    suite.addTest(unittest.makeSuite(MessageTestCase))
+    return suite
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='suite')
Copyright (C) 2012-2017 Edgewall Software