docstr: Test PyUnicode_DecodeUTF8()
docstr_tok: ["Test","PyUnicode_DecodeUTF8","(",")"]
code: def test_decodeutf8(self):
      """Test PyUnicode_DecodeUTF8()"""
      decodeutf8 = _testcapi.unicode_decodeutf8
  
      for s in ["abc", "\xa1\xa2", "\u4f60\u597d", "a\U0001f600"]:
          b = s.encode("utf-8")
          self.assertEqual(decodeutf8(b), s)
          self.assertEqual(decodeutf8(b, "strict"), s)
  
      self.assertRaises(UnicodeDecodeError, decodeutf8, b"\x80")
      self.assertRaises(UnicodeDecodeError, decodeutf8, b"\xc0")
      self.assertRaises(UnicodeDecodeError, decodeutf8, b"\xff")
      self.assertRaises(UnicodeDecodeError, decodeutf8, b"a\xf0\x9f")
      self.assertEqual(decodeutf8(b"a\xf0\x9f", "replace"), "a\ufffd")
      self.assertEqual(decodeutf8(b"a\xf0\x9fb", "replace"), "a\ufffdb")
  
      self.assertRaises(LookupError, decodeutf8, b"a\x80", "foo")
  
imports: import unittest
  import sys
  from test.support import import_helper
label_desc: Use image node_id 4 for calling the CAPITest obj's underlying member method code with example usage: obj.test_decodeutf8() without return types