docstr: Test PyUnicode_Decode()
docstr_tok: ["Test","PyUnicode_Decode","(",")"]
code: def test_decode(self):
      """Test PyUnicode_Decode()"""
      decode = _testcapi.unicode_decode
  
      self.assertEqual(decode(b"[\xe2\x82\xac]", "utf-8"), "[\u20ac]")
      self.assertEqual(decode(b"[\xa4]", "iso8859-15"), "[\u20ac]")
      self.assertEqual(
          decode(b"[\xa4]", "iso8859-15", "strict"), "[\u20ac]"
      )
      self.assertRaises(UnicodeDecodeError, decode, b"[\xa4]", "utf-8")
      self.assertEqual(
          decode(b"[\xa4]", "utf-8", "replace"), "[\ufffd]"
      )
  
      self.assertEqual(decode(b"[\xe2\x82\xac]", NULL), "[\u20ac]")
      self.assertEqual(decode(b"[\xa4]", NULL, "replace"), "[\ufffd]")
  
      self.assertRaises(LookupError, decode, b"\xa4", "foo")
      self.assertRaises(LookupError, decode, b"\xa4", "utf-8", "foo")
  
imports: import unittest
  import sys
  from test.support import import_helper
label_desc: Use image node_id 2 for calling the CAPITest obj's underlying member method code with example usage: obj.test_decode() without return types