mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 22:49:32 -02:30
Validate against ansible variables on ad hoc launch
Share code between this check for ad hoc and JT callback
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import os
|
||||
import pytest
|
||||
from uuid import uuid4
|
||||
import json
|
||||
|
||||
from django.core.cache import cache
|
||||
|
||||
@@ -115,3 +116,12 @@ def test_memoize_parameter_error():
|
||||
with pytest.raises(common.IllegalArgumentError):
|
||||
fn()
|
||||
|
||||
|
||||
def test_extract_ansible_vars():
|
||||
my_dict = {
|
||||
"foobar": "baz",
|
||||
"ansible_connetion_setting": "1928"
|
||||
}
|
||||
redacted, var_list = common.extract_ansible_vars(json.dumps(my_dict))
|
||||
assert var_list == set(['ansible_connetion_setting'])
|
||||
assert redacted == {"foobar": "baz"}
|
||||
|
||||
Reference in New Issue
Block a user