code: def testAddErrorClassCodeString(self):
      LASTUSED = MPI.COMM_WORLD.Get_attr(MPI.LASTUSEDCODE)
      try:
          errclass = MPI.Add_error_class()
      except NotImplementedError:
          self.skipTest("mpi-add_error_class")
      lastused = MPI.COMM_WORLD.Get_attr(MPI.LASTUSEDCODE)
      self.assertEqual(errclass, lastused)
      errstr = MPI.Get_error_string(errclass)
      self.assertEqual(errstr, "")
      MPI.Add_error_string(errclass, "error class")
      self.assertEqual(MPI.Get_error_string(errclass), "error class")
      errcode1 = MPI.Add_error_code(errclass)
      errstr = MPI.Get_error_string(errcode1)
      self.assertEqual(errstr, "")
      MPI.Add_error_string(errcode1, "error code 1")
      self.assertEqual(MPI.Get_error_class(errcode1), errclass)
      self.assertEqual(MPI.Get_error_string(errcode1), "error code 1")
      errcode2 = MPI.Add_error_code(errclass)
      errstr = MPI.Get_error_string(errcode2)
      self.assertEqual(errstr, "")
      MPI.Add_error_string(errcode2, "error code 2")
      self.assertEqual(MPI.Get_error_class(errcode2), errclass)
      self.assertEqual(MPI.Get_error_string(errcode2), "error code 2")
      #
      with self.catchNotImplementedError(4, 1):
          with self.assertRaises(MPI.Exception):
              MPI.Remove_error_class(errclass)
          with self.assertRaises(MPI.Exception):
              MPI.Remove_error_code(errcode2)
          MPI.Remove_error_string(errcode2)
          self.assertEqual(MPI.Get_error_string(errcode2), "")
          MPI.Remove_error_code(errcode2)
          with self.assertRaises(MPI.Exception):
              MPI.Remove_error_code(errcode2)
          #
          with self.assertRaises(MPI.Exception):
              MPI.Remove_error_class(errclass)
          with self.assertRaises(MPI.Exception):
              MPI.Remove_error_code(errcode1)
          MPI.Remove_error_string(errcode1)
          self.assertEqual(MPI.Get_error_string(errcode1), "")
          MPI.Remove_error_code(errcode1)
          with self.assertRaises(MPI.Exception):
              MPI.Remove_error_code(errcode1)
          #
          with self.assertRaises(MPI.Exception):
              MPI.Remove_error_class(errclass)
          MPI.Remove_error_string(errclass)
          self.assertEqual(MPI.Get_error_string(errclass), "")
          MPI.Remove_error_class(errclass)
          with self.assertRaises(MPI.Exception):
              MPI.Remove_error_class(errclass)
      #
      try:
          MPI.Remove_error_class(0)
          self.fail("expected Exception")
      except (MPI.Exception, NotImplementedError):
          pass
      try:
          MPI.Remove_error_code(0)
          self.fail("expected Exception")
      except (MPI.Exception, NotImplementedError):
          pass
      try:
          MPI.Remove_error_string(0)
          self.fail("expected Exception")
      except (MPI.Exception, NotImplementedError):
          pass
  
file_path: mpi4py/test/test_errorcode.py
imports: from mpi4py import MPI
  import mpiunittest
label_desc: Use image node_id 6 for calling the TestErrorCode obj's underlying member method code with example usage: obj.testAddErrorClassCodeString() without return types