|
|
|
@ -18,7 +18,7 @@
|
|
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
|
__metaclass__ = type
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.errors import AnsibleActionFail
|
|
|
|
|
from ansible.compat.tests import unittest
|
|
|
|
|
from ansible.compat.tests.mock import patch, MagicMock, Mock
|
|
|
|
|
from ansible.plugins.action.raw import ActionModule
|
|
|
|
@ -43,7 +43,7 @@ class TestCopyResultExclude(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
play_context = Mock()
|
|
|
|
|
task = MagicMock(Task)
|
|
|
|
|
task.async = MagicMock()
|
|
|
|
|
task.async = False
|
|
|
|
|
connection = Mock()
|
|
|
|
|
|
|
|
|
|
task.args = {'_raw_params': 'Args1'}
|
|
|
|
@ -60,25 +60,22 @@ class TestCopyResultExclude(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
play_context = Mock()
|
|
|
|
|
task = MagicMock(Task)
|
|
|
|
|
task.async = MagicMock()
|
|
|
|
|
task.async = False
|
|
|
|
|
connection = Mock()
|
|
|
|
|
|
|
|
|
|
task.args = {'_raw_params': 'Args1'}
|
|
|
|
|
play_context.check_mode = True
|
|
|
|
|
|
|
|
|
|
self.mock_am = ActionModule(task, connection, play_context, loader=None, templar=None, shared_loader_obj=None)
|
|
|
|
|
self.mock_am._low_level_execute_command = Mock(return_value = {})
|
|
|
|
|
self.mock_am.display = Mock()
|
|
|
|
|
|
|
|
|
|
skipped_result = self.mock_am.run()
|
|
|
|
|
|
|
|
|
|
self.assertEqual(skipped_result.get('skipped'), True)
|
|
|
|
|
try:
|
|
|
|
|
self.mock_am = ActionModule(task, connection, play_context, loader=None, templar=None, shared_loader_obj=None)
|
|
|
|
|
except AnsibleActionFail:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def test_raw_test_environment_is_None(self):
|
|
|
|
|
|
|
|
|
|
play_context = Mock()
|
|
|
|
|
task = MagicMock(Task)
|
|
|
|
|
task.async = MagicMock()
|
|
|
|
|
task.async = False
|
|
|
|
|
connection = Mock()
|
|
|
|
|
|
|
|
|
|
task.args = {'_raw_params': 'Args1'}
|
|
|
|
@ -95,7 +92,7 @@ class TestCopyResultExclude(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
play_context = Mock()
|
|
|
|
|
task = MagicMock(Task)
|
|
|
|
|
task.async = MagicMock()
|
|
|
|
|
task.async = False
|
|
|
|
|
connection = Mock()
|
|
|
|
|
|
|
|
|
|
task.args = {'_raw_params': 'Args1'}
|
|
|
|
|