Move check_mode setting to the proper location regardless of version

pull/175/head
Nathaniel Case 2022-04-25 10:57:04 -04:00
parent 0c77d18f32
commit e76854d1e1
4 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,3 @@
---
trivial:
- check_mode has been removed from play_context, set on task instead for unit tests

View File

@ -44,6 +44,7 @@ Parameters
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=raw</span>
/ <span style="color: red">required</span>
</div>
</td>

View File

@ -25,7 +25,10 @@ except ImportError:
class TestUpdate_Fact(unittest.TestCase):
def setUp(self):
task = MagicMock(Task)
# Ansible > 2.13 looks for check_mode in task
task.check_mode = False
play_context = MagicMock()
# Ansible <= 2.13 looks for check_mode in play_context
play_context.check_mode = False
connection = MagicMock()
fake_loader = {}

View File

@ -81,7 +81,10 @@ INVALID_JINJA = [
class TestUpdate_Fact(unittest.TestCase):
def setUp(self):
task = MagicMock(Task)
# Ansible > 2.13 looks for check_mode in task
task.check_mode = False
play_context = MagicMock()
# Ansible <= 2.13 looks for check_mode in play_context
play_context.check_mode = False
connection = MagicMock()
fake_loader = {}