code: def test_build_descriptor(self):
      expected_file_descriptor_list = [
          """
            name: "tfx/utils/testdata/bar.proto"
            package: "tfx.utils.proto.testdata"
            message_type {
              name: "Bar"
              field {
                name: "int_field"
                number: 1
                label: LABEL_OPTIONAL
                type: TYPE_INT64
              }
            }
            message_type {
              name: "Bar2"
              field {
                name: "str_field"
                number: 1
                label: LABEL_OPTIONAL
                type: TYPE_STRING
              }
            }
            syntax: "proto3"
          """,
          """
            name: "tfx/utils/testdata/foo.proto"
            package: "tfx.utils.proto.testdata"
            dependency: "tfx/utils/testdata/bar.proto"
            message_type {
              name: "Foo"
              field {
                name: "bar"
                number: 1
                label: LABEL_OPTIONAL
                type: TYPE_MESSAGE
                type_name: ".tfx.utils.proto.testdata.Bar"
              }
              field {
                name: "bar2"
                number: 2
                label: LABEL_OPTIONAL
                type: TYPE_MESSAGE
                type_name: ".tfx.utils.proto.testdata.Bar2"
              }
            }
            message_type {
              name: "Foo2"
              field {
                name: "value"
                number: 1
                label: LABEL_OPTIONAL
                type: TYPE_INT64
              }
            }
            message_type {
              name: "TestProto"
              field {
                name: "string_value"
                number: 1
                label: LABEL_OPTIONAL
                type: TYPE_STRING
              }
              field {
                name: "int_value"
                number: 2
                label: LABEL_OPTIONAL
                type: TYPE_INT32
              }
              field {
                name: "double_value"
                number: 3
                label: LABEL_OPTIONAL
                type: TYPE_DOUBLE
              }
            }
            syntax: "proto3"
          """,
      ]
      actual_file_descriptor = descriptor_pb2.FileDescriptorSet()
      proto_utils.build_file_descriptor_set(
          foo_pb2.Foo, actual_file_descriptor
      )
      self.assertLen(actual_file_descriptor.file, 2)
      actual_file_descriptor_sorted = sorted(
          list(actual_file_descriptor.file), key=lambda fd: fd.name
      )
      for expected, actual in zip(
          expected_file_descriptor_list, actual_file_descriptor_sorted
      ):
          self.assertProtoPartiallyEquals(expected, actual)
  
file_path: tfx/tfx/utils/proto_utils_test.py
imports: import tensorflow
  from tfx.utils import proto_utils
  from tfx.utils import test_case_utils
  from tfx.utils.testdata import foo_pb2
  from google.protobuf import any_pb2
  from google.protobuf import descriptor_pb2
label_desc: Use image node_id 7 for calling the ProtoUtilsTest obj's underlying member method code with example usage: obj.test_build_descriptor() without return types