docstr: Test PyUnicode_New()
docstr_tok: ["Test","PyUnicode_New","(",")"]
code: def test_new(self):
      """Test PyUnicode_New()"""
      from _testcapi import unicode_new as new
  
      for maxchar in 0, 0x61, 0xA1, 0x4F60, 0x1F600, 0x10FFFF:
          self.assertEqual(new(0, maxchar), "")
          self.assertEqual(new(5, maxchar), chr(maxchar) * 5)
          self.assertRaises(MemoryError, new, PY_SSIZE_T_MAX, maxchar)
      self.assertEqual(new(0, 0x110000), "")
      self.assertRaises(MemoryError, new, PY_SSIZE_T_MAX // 2, 0x4F60)
      self.assertRaises(
          MemoryError, new, PY_SSIZE_T_MAX // 2 + 1, 0x4F60
      )
      self.assertRaises(MemoryError, new, PY_SSIZE_T_MAX // 2, 0x1F600)
      self.assertRaises(
          MemoryError, new, PY_SSIZE_T_MAX // 2 + 1, 0x1F600
      )
      self.assertRaises(MemoryError, new, PY_SSIZE_T_MAX // 4, 0x1F600)
      self.assertRaises(
          MemoryError, new, PY_SSIZE_T_MAX // 4 + 1, 0x1F600
      )
      self.assertRaises(SystemError, new, 5, 0x110000)
      self.assertRaises(SystemError, new, -1, 0)
      self.assertRaises(SystemError, new, PY_SSIZE_T_MIN, 0)
  
imports: import unittest
  import sys
  from test import support
  from test.support import import_helper
label_desc: Use image node_id 1 for calling the CAPITest obj's underlying member method code with example usage: obj.test_new() without return types