diff options
author | Hye-Shik Chang <hyeshik@gmail.com> | 2008-02-08 17:10:20 (GMT) |
---|---|---|
committer | Hye-Shik Chang <hyeshik@gmail.com> | 2008-02-08 17:10:20 (GMT) |
commit | 01612e7dec9fcbd0733137aa90f0f21cfa49299f (patch) | |
tree | aa75413d4f93ab4c6ddb0ea582172cabf7874633 /Lib/test/test_multibytecodec_support.py | |
parent | 27d339446af6fbd636c58090c5c7e15ec4551dd9 (diff) | |
download | cpython-01612e7dec9fcbd0733137aa90f0f21cfa49299f.zip cpython-01612e7dec9fcbd0733137aa90f0f21cfa49299f.tar.gz cpython-01612e7dec9fcbd0733137aa90f0f21cfa49299f.tar.bz2 |
Update big5hkscs codec to conform to the HKSCS:2004 revision.
Diffstat (limited to 'Lib/test/test_multibytecodec_support.py')
-rw-r--r-- | Lib/test/test_multibytecodec_support.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py index 197f777..57a4751 100644 --- a/Lib/test/test_multibytecodec_support.py +++ b/Lib/test/test_multibytecodec_support.py @@ -323,9 +323,17 @@ class TestBase_Mapping(unittest.TestCase): def _testpoint(self, csetch, unich): if (csetch, unich) not in self.pass_enctest: - self.assertEqual(unich.encode(self.encoding), csetch) + try: + self.assertEqual(unich.encode(self.encoding), csetch) + except UnicodeError, exc: + self.fail('Encoding failed while testing %s -> %s: %s' % ( + repr(unich), repr(csetch), exc.reason)) if (csetch, unich) not in self.pass_dectest: - self.assertEqual(unicode(csetch, self.encoding), unich) + try: + self.assertEqual(csetch.decode(self.encoding), unich) + except UnicodeError, exc: + self.fail('Decoding failed while testing %s -> %s: %s' % ( + repr(csetch), repr(unich), exc.reason)) def load_teststring(encoding): from test import cjkencodings_test |