if name in {"a", "c", "e"}: continue
step.draw.assert_called_once_with()
pipeline.poof()
for name, step in pipeline.named_steps.items():
if name in {"a", "c", "e"}: continue
step.poof.assert_called_once_with()
After Change
Test calling fit, transform, and poof on the pipeline
pipeline = VisualPipeline([
("a", mock.MagicMock(MockTransformer())),
("b", mock.MagicMock(MockVisualTransformer())),
("c", mock.MagicMock(MockTransformer())),
("d", mock.MagicMock(MockVisualTransformer())),
("e", mock.MagicMock(MockEstimator()),)
])
X = [[1, 1, 1, 1, 1],
[2, 2, 2, 2, 2],
[3, 3, 3, 3, 3]]
y = [1, 2, 3, 4, 5]
pipeline.fit(X, y)
for name, step in pipeline.named_steps.items():
step.fit.assert_called_once_with(X, y)
pipeline.transform(X)
for name, step in pipeline.named_steps.items():
if name == "e": continue
step.transform.assert_called_once_with(X)
pipeline.poof()
for name, step in pipeline.named_steps.items():
if name in {"a", "c", "e"}: continue
step.poof.assert_called_once_with(outpath=None)