def test_succeeded_actually_succeeded(self, super_succeeded, failed): """ Test the succeeded() handler for the case when the task actually succeeded. """ command = BindRelatedPollingCommand('name', 'description', mock.MagicMock(), self.context) task = mock.MagicMock() task.result = {'succeeded': True} command.succeeded(task) super_succeeded.assert_called_once_with(task) self.assertEqual(failed.call_count, 0)
def test_failed(self, super_failed): """ Test the failed() handler. """ command = BindRelatedPollingCommand('name', 'description', mock.MagicMock(), self.context) task = mock.MagicMock() command.failed(task) super_failed.assert_called_once_with(task) self.assertEqual(self.prompt.get_write_tags(), ['error_message'])