code: def testNestedOptions(self):
      nested_message = (
          unittest_custom_options_pb2.NestedOptionType.NestedMessage.DESCRIPTOR
      )
      self.assertEqual(
          1001,
          nested_message.GetOptions().Extensions[
              unittest_custom_options_pb2.message_opt1
          ],
      )
      nested_field = nested_message.fields_by_name["nested_field"]
      self.assertEqual(
          1002,
          nested_field.GetOptions().Extensions[
              unittest_custom_options_pb2.field_opt1
          ],
      )
      outer_message = (
          unittest_custom_options_pb2.NestedOptionType.DESCRIPTOR
      )
      nested_enum = outer_message.enum_types_by_name["NestedEnum"]
      self.assertEqual(
          1003,
          nested_enum.GetOptions().Extensions[
              unittest_custom_options_pb2.enum_opt1
          ],
      )
      nested_enum_value = outer_message.enum_values_by_name[
          "NESTED_ENUM_VALUE"
      ]
      self.assertEqual(
          1004,
          nested_enum_value.GetOptions().Extensions[
              unittest_custom_options_pb2.enum_value_opt1
          ],
      )
      nested_extension = outer_message.extensions_by_name[
          "nested_extension"
      ]
      self.assertEqual(
          1005,
          nested_extension.GetOptions().Extensions[
              unittest_custom_options_pb2.field_opt2
          ],
      )
  
imports: import unittest
  from google.protobuf import unittest_custom_options_pb2
  from google.protobuf import unittest_import_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf import descriptor_pb2
  from google.protobuf import descriptor
  from google.protobuf import text_format
label_desc: Use image node_id 11 for calling the DescriptorTest obj's underlying member method code with example usage: obj.testNestedOptions() without return types