summaryrefslogtreecommitdiff
path: root/test/test__init__.py
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2011-04-12 09:10:57 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2011-04-12 09:10:57 +0000
commit81342e2ec4bd203e386a60c2e3a7a392bcf97b1d (patch)
tree753f5c289bc6becdaf2b9a577474f660ef02a473 /test/test__init__.py
parent06779143bf3f500590fd4dd5e5549d32743e0938 (diff)
downloaddocutils-81342e2ec4bd203e386a60c2e3a7a392bcf97b1d.tar.gz
Workaround for unicode messages in Exception instances with Python < 2.6.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7007 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/test__init__.py')
-rw-r--r--test/test__init__.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test__init__.py b/test/test__init__.py
new file mode 100644
index 000000000..93d2d4bc5
--- /dev/null
+++ b/test/test__init__.py
@@ -0,0 +1,28 @@
+#! /usr/bin/env python
+# .. coding: utf8
+# $Id$
+# Author: Günter Milde <milde@users.sourceforge.net>
+# Copyright: This module has been placed in the public domain.
+
+"""
+Test module for the docutils' __init__.py.
+"""
+
+import unittest
+import sys
+import DocutilsTestSupport # must be imported before docutils
+import docutils
+
+class ApplicationErrorTests(unittest.TestCase):
+
+ def test_message(self):
+ err = docutils.ApplicationError('the message')
+ self.assertEquals(unicode(err), u'the message')
+
+ def test_non_ASCII_message(self):
+ err = docutils.ApplicationError(u'\u0169')
+ self.assertEquals(unicode(err), u'\u0169')
+
+
+if __name__ == '__main__':
+ unittest.main()