diff options
Diffstat (limited to 'test/units/module_utils/basic/test_run_command.py')
-rw-r--r-- | test/units/module_utils/basic/test_run_command.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/units/module_utils/basic/test_run_command.py b/test/units/module_utils/basic/test_run_command.py index 04211e2d..259ac6c4 100644 --- a/test/units/module_utils/basic/test_run_command.py +++ b/test/units/module_utils/basic/test_run_command.py @@ -12,7 +12,7 @@ from io import BytesIO import pytest -from ansible.module_utils._text import to_native +from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.six import PY2 from ansible.module_utils.compat import selectors @@ -109,7 +109,7 @@ def mock_subprocess(mocker): super(MockSelector, self).close() self._file_objs = [] - selectors.DefaultSelector = MockSelector + selectors.PollSelector = MockSelector subprocess = mocker.patch('ansible.module_utils.basic.subprocess') subprocess._output = {mocker.sentinel.stdout: SpecialBytesIO(b'', fh=mocker.sentinel.stdout), @@ -194,7 +194,7 @@ class TestRunCommandPrompt: @pytest.mark.parametrize('stdin', [{}], indirect=['stdin']) def test_prompt_no_match(self, mocker, rc_am): rc_am._os._cmd_out[mocker.sentinel.stdout] = BytesIO(b'hello') - (rc, _, _) = rc_am.run_command('foo', prompt_regex='[pP]assword:') + (rc, stdout, stderr) = rc_am.run_command('foo', prompt_regex='[pP]assword:') assert rc == 0 @pytest.mark.parametrize('stdin', [{}], indirect=['stdin']) @@ -204,7 +204,7 @@ class TestRunCommandPrompt: fh=mocker.sentinel.stdout), mocker.sentinel.stderr: SpecialBytesIO(b'', fh=mocker.sentinel.stderr)} - (rc, _, _) = rc_am.run_command('foo', prompt_regex=r'[pP]assword:', data=None) + (rc, stdout, stderr) = rc_am.run_command('foo', prompt_regex=r'[pP]assword:', data=None) assert rc == 257 @@ -212,7 +212,7 @@ class TestRunCommandRc: @pytest.mark.parametrize('stdin', [{}], indirect=['stdin']) def test_check_rc_false(self, rc_am): rc_am._subprocess.Popen.return_value.returncode = 1 - (rc, _, _) = rc_am.run_command('/bin/false', check_rc=False) + (rc, stdout, stderr) = rc_am.run_command('/bin/false', check_rc=False) assert rc == 1 @pytest.mark.parametrize('stdin', [{}], indirect=['stdin']) |