docstr: Test PyUnicode_Resize()
docstr_tok: ["Test","PyUnicode_Resize","(",")"]
code: def test_resize(self):
      """Test PyUnicode_Resize()"""
      from _testcapi import unicode_resize as resize
  
      strings = [
          # all strings have exactly 3 characters
          "abc",
          "\xa1\xa2\xa3",
          "\u4f60\u597d\u4e16",
          "\U0001f600\U0001f601\U0001f602",
      ]
      for s in strings:
          self.assertEqual(resize(s, 3), (s, 0))
          self.assertEqual(resize(s, 2), (s[:2], 0))
          self.assertEqual(resize(s, 4), (s + "\0", 0))
          self.assertEqual(resize(s, 10), (s + "\0" * 7, 0))
          self.assertEqual(resize(s, 0), ("", 0))
          self.assertRaises(MemoryError, resize, s, PY_SSIZE_T_MAX)
          self.assertRaises(SystemError, resize, s, -1)
          self.assertRaises(SystemError, resize, s, PY_SSIZE_T_MIN)
      self.assertRaises(SystemError, resize, b"abc", 0)
      self.assertRaises(SystemError, resize, [], 0)
      self.assertRaises(SystemError, resize, NULL, 0)
  
imports: import unittest
  import sys
  from test import support
  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_resize() without return types