16 lines
360 B
Python
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))
|