docstr: Test PyUnicode_DecodeCharmap()
docstr_tok: ["Test","PyUnicode_DecodeCharmap","(",")"]
code: def test_decodecharmap(self):
      """Test PyUnicode_DecodeCharmap()"""
      decodecharmap = _testcapi.unicode_decodecharmap
  
      self.assertEqual(
          decodecharmap(b"\3\0\7", {0: "a", 3: "b", 7: "c"}), "bac"
      )
      self.assertEqual(decodecharmap(b"\1\0\2", ["a", "b", "c"]), "bac")
      self.assertEqual(decodecharmap(b"\1\0\2", "abc"), "bac")
      self.assertEqual(
          decodecharmap(b"\1\0\2", ["\xa1", "\xa2", "\xa3"]),
          "\xa2\xa1\xa3",
      )
      self.assertEqual(
          decodecharmap(b"\1\0\2", ["\u4f60", "\u597d", "\u4e16"]),
          "\u597d\u4f60\u4e16",
      )
      self.assertEqual(
          decodecharmap(
              b"\1\0\2", ["\U0001f600", "\U0001f601", "\U0001f602"]
          ),
          "\U0001f601\U0001f600\U0001f602",
      )
  
      self.assertEqual(decodecharmap(b"\1\0\2", [97, 98, 99]), "bac")
      self.assertEqual(decodecharmap(b"\1\0\2", ["", "b", "cd"]), "bcd")
  
      self.assertRaises(UnicodeDecodeError, decodecharmap, b"\0", {})
      self.assertRaises(
          UnicodeDecodeError, decodecharmap, b"\0", {0: None}
      )
      self.assertEqual(
          decodecharmap(b"\1\0\2", [None, "b", "c"], "replace"),
          "b\ufffdc",
      )
      self.assertEqual(decodecharmap(b"\1\0\2\xff", NULL), "\1\0\2\xff")
      self.assertRaises(TypeError, decodecharmap, b"\0", 42)
  
imports: import unittest
  import sys
  from test.support import import_helper
label_desc: Use image node_id 17 for calling the CAPITest obj's underlying member method code with example usage: obj.test_decodecharmap() without return types