docstr: Test PyUnicode_AsUTF8String()
docstr_tok: ["Test","PyUnicode_AsUTF8String","(",")"]
code: def test_asutf8string(self):
      """Test PyUnicode_AsUTF8String()"""
      asutf8string = _testcapi.unicode_asutf8string
  
      for s in ["abc", "\xa1\xa2", "\u4f60\u597d", "a\U0001f600"]:
          self.assertEqual(asutf8string(s), s.encode("utf-8"))
  
      self.assertRaises(UnicodeEncodeError, asutf8string, "\ud8ff")
      self.assertRaises(TypeError, asutf8string, b"abc")
      self.assertRaises(TypeError, asutf8string, [])
  
imports: import unittest
  import sys
  from test.support import import_helper
label_desc: Use image node_id 6 for calling the CAPITest obj's underlying member method code with example usage: obj.test_asutf8string() without return types