mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Allow AnsibleModules to be instantiated more than once in a module
Fix SELINUX monkeypatch in test_basic
This commit is contained in:
parent
0f373c1767
commit
44e21f7062
6 changed files with 66 additions and 17 deletions
|
@ -26,6 +26,12 @@ import json
|
|||
from ansible.compat.tests import unittest
|
||||
from units.mock.procenv import swap_stdin_and_argv
|
||||
|
||||
try:
|
||||
from importlib import reload
|
||||
except:
|
||||
# Py2 has reload as a builtin
|
||||
pass
|
||||
|
||||
class TestAnsibleModuleExitJson(unittest.TestCase):
|
||||
|
||||
def test_module_utils_basic_safe_eval(self):
|
||||
|
@ -34,6 +40,7 @@ class TestAnsibleModuleExitJson(unittest.TestCase):
|
|||
args = json.dumps(dict(ANSIBLE_MODULE_ARGS={}, ANSIBLE_MODULE_CONSTANTS={}))
|
||||
|
||||
with swap_stdin_and_argv(stdin_data=args):
|
||||
reload(basic)
|
||||
am = basic.AnsibleModule(
|
||||
argument_spec=dict(),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue