Don't use 'from ansible.module_utils import foo' style here as it breaks (#15756)

py.test"
pull/15949/head
Robin Roth 9 years ago committed by Toshio Kuratomi
parent 0ad0b3d83b
commit 03e7f54071

@ -30,8 +30,7 @@ from ansible.compat.tests.mock import call, MagicMock, Mock, patch, sentinel
from units.mock.procenv import swap_stdin_and_argv
from ansible.module_utils import basic
from ansible.module_utils.basic import AnsibleModule
import ansible.module_utils.basic
class OpenBytesIO(BytesIO):
"""BytesIO with dummy close() method
@ -67,8 +66,8 @@ class TestAnsibleModuleRunCommand(unittest.TestCase):
self.stdin_swap = swap_stdin_and_argv(stdin_data=args)
self.stdin_swap.__enter__()
basic._ANSIBLE_ARGS = None
self.module = AnsibleModule(argument_spec=dict())
ansible.module_utils.basic._ANSIBLE_ARGS = None
self.module = ansible.module_utils.basic.AnsibleModule(argument_spec=dict())
self.module.fail_json = MagicMock(side_effect=SystemExit)
self.os = patch('ansible.module_utils.basic.os').start()

Loading…
Cancel
Save