def test_run_action_failed(self): error = self.task.node.submit_command.side_effect = node.Error("Oops") assert not serviceinstance.run_action(self.task, self.action) self.task.notify.assert_called_with(self.failed) self.task.buffer_store.open.return_value.write.assert_called_with( "Node run failure for mock_task: %s" % str(error), )
def raise_error(c): raise node.Error("The error")