code: def testReplaceBeamExecutorWithStub(self):
      pipeline = text_format.Parse(
          """
          deployment_config {
            [type.googleapis.com/tfx.orchestration.IntermediateDeploymentConfig] {
              executor_specs {
                key: "CsvExampleGen"
                value {
                  [type.googleapis.com/tfx.orchestration.executable_spec.BeamExecutableSpec] {
                    python_executor_spec {
                      class_path: "tfx.components.example_gen.csv_example_gen.executor.Executor"
                      extra_flags: "--my_testing_extra_flags=foo"
                    }
                  }
                }
              }
            }
          }""",
          pipeline_pb2.Pipeline(),
      )
      expected = """
          deployment_config {
            [type.googleapis.com/tfx.orchestration.IntermediateDeploymentConfig] {
              executor_specs {
                key: "CsvExampleGen"
                value {
                  [type.googleapis.com/tfx.orchestration.executable_spec.BeamExecutableSpec] {
                    python_executor_spec {
                      class_path: "tfx.experimental.pipeline_testing.base_stub_executor.BaseStubExecutor"
                      extra_flags: "--test_data_dir=/mock/a"
                      extra_flags: "--component_id=CsvExampleGen"
                    }
                  }
                }
              }
            }
          }"""
      pipeline_mock.replace_executor_with_stub(pipeline, "/mock/a", [])
      self.assertProtoEquals(expected, pipeline)
  
file_path: tfx/tfx/experimental/pipeline_testing/pipeline_mock_test.py
imports: import tensorflow
  from tfx.experimental.pipeline_testing import pipeline_mock
  from tfx.proto.orchestration import pipeline_pb2
  from google.protobuf import text_format
label_desc: Use image node_id 2 for calling the PipelineMockTest obj's underlying member method code with example usage: obj.testReplaceBeamExecutorWithStub() without return types