You can use apache_beam.testing.util.assert_that to write tests of
Beam pipelines. This is what Beam uses for its tests, e.g.

https://github.com/apache/beam/blob/master/sdks/python/apache_beam/transforms/util_test.py#L80

On Mon, Jul 13, 2020 at 2:36 PM Sofia’s World <[email protected]> wrote:
>
> Hi all
>  i was wondering if anyone could provide pointers on how  to test a pipeline 
> in python.
> I have the following pipeline
>
> lines = (p
>          | 'Get List of Tickers' >> beam.Map(get_tickers)
>          | 'Split fields'  >> beam.Map(split_fields)
>          | 'Map to String' >> beam.Map(add_year)
>          )
> result = p.run()
>
> Now i can easily test each individual function for each step (get_tickers, 
> split_fields, add_year)
>
> but is there a way to test the pipeline 'as a whole' ?#
>
> Could anyone point me to some examples?
>
> kind regards
>
>
>
>
>

Reply via email to