Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test__get_outputs_additional(self):
self_ = MagicMock(autospec=MLPipeline)
pipeline = {
'outputs': {
'default': ['some', 'outputs'],
'additional': ['other', 'outputs']
}
}
outputs = None
returned = MLPipeline._get_outputs(self_, pipeline, outputs)
expected = {
'default': ['some', 'outputs'],
'additional': ['other', 'outputs']
}
assert returned == expected
self_._get_block_outputs.assert_not_called()
def test__get_outputs_defaults(self):
self_ = MagicMock(autospec=MLPipeline)
pipeline = dict()
outputs = {
'default': ['some', 'outputs']
}
returned = MLPipeline._get_outputs(self_, pipeline, outputs)
expected = {
'default': ['some', 'outputs']
}
assert returned == expected
self_._get_block_outputs.assert_not_called()
def test__get_outputs_no_outputs(self):
self_ = MagicMock(autospec=MLPipeline)
self_._last_block_name = 'last_block'
self_._get_block_outputs.return_value = ['some', 'outputs']
pipeline = dict()
outputs = None
returned = MLPipeline._get_outputs(self_, pipeline, outputs)
expected = {
'default': ['some', 'outputs']
}
assert returned == expected
self_._get_block_outputs.assert_called_once_with('last_block')