|
|
@ -7,6 +7,7 @@ __metaclass__ = type
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
import shutil
|
|
|
|
import shutil
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import tempfile
|
|
|
|
import tempfile
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.modules import async_wrapper
|
|
|
|
from ansible.modules import async_wrapper
|
|
|
@ -17,11 +18,10 @@ class TestAsyncWrapper:
|
|
|
|
def test_run_module(self, monkeypatch):
|
|
|
|
def test_run_module(self, monkeypatch):
|
|
|
|
|
|
|
|
|
|
|
|
def mock_get_interpreter(module_path):
|
|
|
|
def mock_get_interpreter(module_path):
|
|
|
|
return ['/usr/bin/python']
|
|
|
|
return [sys.executable]
|
|
|
|
|
|
|
|
|
|
|
|
module_result = {'rc': 0}
|
|
|
|
module_result = {'rc': 0}
|
|
|
|
module_lines = [
|
|
|
|
module_lines = [
|
|
|
|
'#!/usr/bin/python',
|
|
|
|
|
|
|
|
'import sys',
|
|
|
|
'import sys',
|
|
|
|
'sys.stderr.write("stderr stuff")',
|
|
|
|
'sys.stderr.write("stderr stuff")',
|
|
|
|
"print('%s')" % json.dumps(module_result)
|
|
|
|
"print('%s')" % json.dumps(module_result)
|
|
|
|