code: def testStrategy(self):
      artifact1 = self._createExamples(1)
      artifact2 = self._createExamples(2)
      artifact3 = self._createExamples(3)
      artifact4 = self._createExamples(4)
      artifact5 = self._createExamples(5)
  
      # Test StaticRange.
      resolver = span_range_strategy.SpanRangeStrategy(
          range_config=range_config_pb2.RangeConfig(
              static_range=range_config_pb2.StaticRange(
                  start_span_number=2, end_span_number=3
              )
          )
      )
      result = resolver.resolve_artifacts(
          self._store,
          {
              "input": [
                  artifact1,
                  artifact2,
                  artifact3,
                  artifact4,
                  artifact5,
              ]
          },
      )
      self.assertIsNotNone(result)
      self.assertEqual(
          {a.uri for a in result["input"]},
          {artifact3.uri, artifact2.uri},
      )
  
      # Test RollingRange.
      resolver = span_range_strategy.SpanRangeStrategy(
          range_config=range_config_pb2.RangeConfig(
              rolling_range=range_config_pb2.RollingRange(num_spans=3)
          )
      )
      result = resolver.resolve_artifacts(
          self._store,
          {
              "input": [
                  artifact1,
                  artifact2,
                  artifact3,
                  artifact4,
                  artifact5,
              ]
          },
      )
      self.assertIsNotNone(result)
      self.assertEqual(
          [a.uri for a in result["input"]],
          [artifact5.uri, artifact4.uri, artifact3.uri],
      )
  
      # Test RollingRange with start_span_number.
      resolver = span_range_strategy.SpanRangeStrategy(
          range_config=range_config_pb2.RangeConfig(
              rolling_range=range_config_pb2.RollingRange(
                  start_span_number=4, num_spans=3
              )
          )
      )
      result = resolver.resolve_artifacts(
          self._store,
          {
              "input": [
                  artifact1,
                  artifact2,
                  artifact3,
                  artifact4,
                  artifact5,
              ]
          },
      )
      self.assertIsNotNone(result)
      self.assertEqual(
          [a.uri for a in result["input"]],
          [artifact5.uri, artifact4.uri],
      )
  
file_path: tfx/tfx/dsl/input_resolution/strategies/span_range_strategy_test.py
imports: import tensorflow
  from tfx.components.example_gen import utils
  from tfx.dsl.input_resolution.strategies import span_range_strategy
  from tfx.orchestration import metadata
  from tfx.proto import range_config_pb2
  from tfx.types import standard_artifacts
  from tfx.utils import test_case_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling the SpanRangeStrategyTest obj's underlying member method code with example usage: obj.testStrategy() without return types