pyinfra/test/unit_tests/pipeline_test.py
2022-05-05 12:49:49 +02:00

16 lines
360 B
Python

from funcy import rcompose
from pyinfra.server.pipeline import Pipeline
from pyinfra.utils.func import lift
def test_mock_pipeline():
data = [1, 2, 3]
f, g, h, u = map(lift, [lambda x: x ** 2, lambda x: x + 2, lambda x: x / 2, lambda x: x])
pipeline = Pipeline(f, g, h, u)
assert list(pipeline(data)) == list(rcompose(f, g, h, u)(data))