mirror of
https://github.com/ansible/awx.git
synced 2026-06-30 02:48:03 -02:30
add support for custom py3 ansible virtualenvs
This commit is contained in:
@@ -87,6 +87,7 @@ def job(mocker):
|
||||
'launch_type': 'manual',
|
||||
'verbosity': 1,
|
||||
'awx_meta_vars.return_value': {},
|
||||
'ansible_virtualenv_path': '',
|
||||
'inventory.get_script_data.return_value': {}})
|
||||
ret.project = mocker.MagicMock(scm_revision='asdf1234')
|
||||
return ret
|
||||
|
||||
@@ -173,12 +173,14 @@ def test_extract_ansible_vars():
|
||||
|
||||
def test_get_custom_venv_choices():
|
||||
bundled_venv = os.path.join(settings.BASE_VENV_PATH, 'ansible', '')
|
||||
assert common.get_custom_venv_choices() == [bundled_venv]
|
||||
bundled_venv_py3 = os.path.join(settings.BASE_VENV_PATH, 'ansible3', '')
|
||||
assert sorted(common.get_custom_venv_choices()) == [bundled_venv, bundled_venv_py3]
|
||||
|
||||
with TemporaryDirectory(dir=settings.BASE_VENV_PATH, prefix='tmp') as temp_dir:
|
||||
os.makedirs(os.path.join(temp_dir, 'bin', 'activate'))
|
||||
assert sorted(common.get_custom_venv_choices()) == [
|
||||
bundled_venv,
|
||||
bundled_venv_py3,
|
||||
os.path.join(temp_dir, '')
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user