code: def testOneof(self):
      desc = unittest_pb2.TestAllTypes.DESCRIPTOR
      self.assertEqual(1, len(desc.oneofs))
      self.assertEqual("oneof_field", desc.oneofs[0].name)
      self.assertEqual(0, desc.oneofs[0].index)
      self.assertIs(desc, desc.oneofs[0].containing_type)
      self.assertIs(desc.oneofs[0], desc.oneofs_by_name["oneof_field"])
      nested_names = set(
          [
              "oneof_uint32",
              "oneof_nested_message",
              "oneof_string",
              "oneof_bytes",
          ]
      )
      self.assertEqual(
          nested_names,
          set([field.name for field in desc.oneofs[0].fields]),
      )
      for field_name, field_desc in desc.fields_by_name.items():
          if field_name in nested_names:
              self.assertIs(desc.oneofs[0], field_desc.containing_oneof)
          else:
              self.assertIsNone(field_desc.containing_oneof)
  
imports: from google.protobuf.internal import test_bad_identifiers_pb2
  from google.protobuf import unittest_custom_options_pb2
  from google.protobuf import unittest_import_pb2
  from google.protobuf import unittest_import_public_pb2
  from google.protobuf import unittest_mset_pb2
  from google.protobuf import unittest_mset_wire_format_pb2
  from google.protobuf import unittest_no_generic_services_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf import service
  from google.protobuf import symbol_database
label_desc: Use image node_id 22 for calling the GeneratorTest obj's underlying member method code with example usage: obj.testOneof() without return types