Verify the crash due to EncodingMap not initialized does not return

This commit is contained in:
Neal Norwitz 2006-06-13 08:41:06 +00:00
parent de4c78a1d7
commit 6d3d339d21

View file

@ -1166,6 +1166,12 @@ class BasicUnicodeTest(unittest.TestCase):
encoder = codecs.getencoder(encoding) encoder = codecs.getencoder(encoding)
self.assertRaises(TypeError, encoder) self.assertRaises(TypeError, encoder)
def test_encoding_map_type_initialized(self):
from encodings import cp1140
# This used to crash, we are only verifying there's no crash.
table_type = type(cp1140.encoding_table)
self.assertEqual(table_type, table_type)
class BasicStrTest(unittest.TestCase): class BasicStrTest(unittest.TestCase):
def test_basics(self): def test_basics(self):
s = "abc123" s = "abc123"