def test_partial_finalize(): pipeline = [discard_evens, finalize(7), square, finalize(9), None, to_str] assert list(flow(range(10), pipeline)) == ["1", "9", "25", "7", "81"]
def test_communication_from_later_to_earlier_pipes(): pipelines = [square, discard_remainder, None, locate(9)] assert list(flow(range(10), pipelines)) == [0, 1, 4, 9]
def test_flow(): pipeline = [discard_evens, finalize(7), square, finalize(9), to_str] assert list(flow(range(10), pipeline)) == ["1", 9, "25", 7, "81"]