def test__store(self,): ex = executor.MyCallback(mock.Mock()) my_host = 'my_host' my_task = 'my_task' my_result = 'my_result' r = mock.Mock() r._host.get_name.return_value = my_host r._task.get_name.return_value = my_task r._result = my_result stat = 'OK' ex._store(r, stat) ex.storage.append.assert_called_once_with( executor.AnsibleExecutionRecord(host=my_host, status=stat, task=my_task, payload=my_result))
def test_v2_runner_on_unreachable(self, mock_store): result = mock.Mock() ex = executor.MyCallback(mock.Mock()) ex.v2_runner_on_unreachable(result) mock_store.assert_called_once_with(result, executor.STATUS_UNREACHABLE)
def test_v2_runner_on_unreachable_super(self, mock_store, mock_callback): ex = executor.MyCallback(mock.Mock()) result = mock.Mock() ex.v2_runner_on_unreachable(result) mock_callback.assert_called_once_with(result)
def test_v2_runner_on_skipped(self, mock_store): result = mock.Mock() ex = executor.MyCallback(mock.Mock()) ex.v2_runner_on_skipped(result) mock_store.assert_called_once_with(result, executor.STATUS_SKIPPED)