]> granicus.if.org Git - python/commitdiff
Verify the crash due to EncodingMap not initialized does not return
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 13 Jun 2006 08:41:06 +0000 (08:41 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 13 Jun 2006 08:41:06 +0000 (08:41 +0000)
Lib/test/test_codecs.py

index 6ea49cc5f9253345ec3c694bee35de7d5d736e5b..8153979a85e291e06c9e9648384602216fe29d94 100644 (file)
@@ -1166,6 +1166,12 @@ class BasicUnicodeTest(unittest.TestCase):
             encoder = codecs.getencoder(encoding)
             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):
     def test_basics(self):
         s = "abc123"