def test_execute_params(self): action = mock.Mock() pipeline = Pipeline(actions=[action]) pipeline.execute(param="value") action.forward.assert_called_with(param="value")
def test_execute(self): action = mock.Mock() pipeline = Pipeline(actions=[action]) pipeline.execute() action.forward.assert_called_with()
def test_rollback_params(self): action = mock.Mock() action2 = mock.Mock() action2.forward.side_effect = NotImplementedError() pipeline = Pipeline(actions=[action, action2]) pipeline.execute(param="value") action.forward.assert_called_with(param="value") action.backward.assert_called_with(param="value") action2.forward.assert_called_with(param="value")