code: def test_raise_with_new_exceptions(self):
      orig = self.orig
  
      match, rest = orig.split(TypeError)
      new1 = OSError("bad file")
      new2 = RuntimeError("bad runtime")
  
      test_cases = [
          ([new1, match, rest], ExceptionGroup("", [new1, orig])),
          ([match, new1, rest], ExceptionGroup("", [new1, orig])),
          ([match, rest, new1], ExceptionGroup("", [new1, orig])),
          (
              [new1, new2, match, rest],
              ExceptionGroup("", [new1, new2, orig]),
          ),
          (
              [new1, match, new2, rest],
              ExceptionGroup("", [new1, new2, orig]),
          ),
          (
              [new2, rest, match, new1],
              ExceptionGroup("", [new2, new1, orig]),
          ),
          (
              [rest, new2, match, new1],
              ExceptionGroup("", [new2, new1, orig]),
          ),
          ([new1, new2, rest], ExceptionGroup("", [new1, new2, rest])),
          (
              [new1, match, new2],
              ExceptionGroup("", [new1, new2, match]),
          ),
          ([rest, new2, new1], ExceptionGroup("", [new2, new1, rest])),
          ([new1, new2], ExceptionGroup("", [new1, new2])),
          ([new2, new1], ExceptionGroup("", [new2, new1])),
      ]
  
      for input, expected in test_cases:
          with self.subTest(input=input):
              res = _testcapi.unstable_exc_prep_reraise_star(
                  orig, input
              )
              self.assertExceptionIsLike(res, expected)
  
imports: import errno
  import os
  import re
  import sys
  import unittest
  from test import support
  from test.support import import_helper
  from test.support.os_helper import TESTFN, TESTFN_UNDECODABLE
  from test.support.script_helper import assert_python_failure
  from test.support.testcase import ExceptionIsLikeMixin
  from .test_misc import decode_stderr
label_desc: Use image node_id 6 for calling the Test_PyUnstable_Exc_PrepReraiseStar obj's underlying member method code with example usage: obj.test_raise_with_new_exceptions() without return types