apache_beam.runners.interactive.testing.pipeline_assertion module

Module to verify implicit cache transforms applied by Interactive Beam.

For internal use only; no backwards-compatibility guarantees. This utility should only be used by Interactive Beam tests. For example, it can be used to verify if the implicit cache transforms are applied as expected when running a pipeline with the InteractiveRunner. It can also be used to verify if a pipeline fragment has pruned unnecessary transforms. It shouldn’t be used to verify equivalence between pipelines if the code to be tested depends on or mutates user code within transforms in pipelines.

apache_beam.runners.interactive.testing.pipeline_assertion.assert_pipeline_equal(test_case, expected_pipeline, actual_pipeline)[source]

Asserts the equivalence between two given apache_beam.Pipeline instances.

Parameters:
  • test_case – (unittest.TestCase) the unittest testcase where it asserts.
  • expected_pipeline – (Pipeline) the pipeline instance expected.
  • actual_pipeline – (Pipeline) the actual pipeline instance to be asserted.
apache_beam.runners.interactive.testing.pipeline_assertion.assert_pipeline_proto_equal(test_case, expected_pipeline_proto, actual_pipeline_proto)[source]

Asserts the equivalence between two pipeline proto representations.

apache_beam.runners.interactive.testing.pipeline_assertion.assert_pipeline_proto_contain_top_level_transform(test_case, pipeline_proto, transform_label)[source]

Asserts the top level transforms contain a transform with the given transform label.

apache_beam.runners.interactive.testing.pipeline_assertion.assert_pipeline_proto_not_contain_top_level_transform(test_case, pipeline_proto, transform_label)[source]

Asserts the top level transforms do not contain a transform with the given transform label.