mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
add unit test for survey vars as strings
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
def test_missing_project_error(job_template_factory):
|
def test_missing_project_error(job_template_factory):
|
||||||
@@ -34,6 +35,16 @@ def test_inventory_credential_contradictions(job_template_factory):
|
|||||||
assert 'inventory' in validation_errors
|
assert 'inventory' in validation_errors
|
||||||
assert 'credential' in validation_errors
|
assert 'credential' in validation_errors
|
||||||
|
|
||||||
|
def test_survey_answers_as_string(job_template_factory):
|
||||||
|
objects = job_template_factory(
|
||||||
|
'job-template-with-survey',
|
||||||
|
survey=['var1'],
|
||||||
|
persisted=False)
|
||||||
|
jt = objects.job_template
|
||||||
|
user_extra_vars = json.dumps({'var1': 'asdf'})
|
||||||
|
accepted, ignored = jt._accept_or_ignore_job_kwargs(extra_vars=user_extra_vars)
|
||||||
|
assert 'var1' in accepted['extra_vars']
|
||||||
|
|
||||||
@pytest.mark.survey
|
@pytest.mark.survey
|
||||||
def test_survey_password_list(job_with_secret_key_unit):
|
def test_survey_password_list(job_with_secret_key_unit):
|
||||||
"""Verify that survey_password_variables method gives a list of survey passwords"""
|
"""Verify that survey_password_variables method gives a list of survey passwords"""
|
||||||
|
|||||||
Reference in New Issue
Block a user