code: def testBeamSettings(self):
      executor_context = base_beam_executor.BaseBeamExecutor.Context(
          beam_pipeline_args=["--runner=DirectRunner"]
      )
      executor = _TestExecutor(executor_context)
      options = executor._make_beam_pipeline().options.view_as(
          StandardOptions
      )
      self.assertEqual(
          "DirectRunner", options.view_as(StandardOptions).runner
      )
      # Verify labels.
      self.assertListEqual(
          [
              "tfx_executor=third_party_executor",
              "tfx_py_version=%d-%d"
              % (sys.version_info.major, sys.version_info.minor),
              "tfx_version=%s" % version.__version__.replace(".", "-"),
          ],
          options.view_as(GoogleCloudOptions).labels,
      )
  
      executor_context = base_beam_executor.BaseBeamExecutor.Context(
          beam_pipeline_args=["--direct_num_workers=2"]
      )
      executor = StatisticsGenExecutor(executor_context)
      options = executor._make_beam_pipeline().options.view_as(
          DirectOptions
      )
      self.assertEqual(2, options.direct_num_workers)
      # Verify labels.
      self.assertListEqual(
          [
              "tfx_executor=tfx-components-statistics_gen-executor-executor",
              "tfx_py_version=%d-%d"
              % (sys.version_info.major, sys.version_info.minor),
              "tfx_version=%s" % version.__version__.replace(".", "-"),
          ],
          options.view_as(GoogleCloudOptions).labels,
      )
  
file_path: tfx/tfx/dsl/components/base/base_beam_executor_test.py
imports: import sys
  from typing import Any, Dict, List
  from unittest import mock
  from apache_beam.options.pipeline_options import DirectOptions
  from apache_beam.options.pipeline_options import GoogleCloudOptions
  from apache_beam.options.pipeline_options import StandardOptions
  import tensorflow
  from tfx import types
  from tfx import version
  from tfx.components.statistics_gen.executor import Executor
  from tfx.dsl.components.base import base_beam_executor
label_desc: Use image node_id 1 for calling the BaseBeamExecutorTest obj's underlying member method code with example usage: obj.testBeamSettings() without return types