mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
add unit test for survey vars as strings
This commit is contained in:
parent
a94e97366a
commit
fab0ff18d8
@ -1,4 +1,5 @@
|
||||
import pytest
|
||||
import json
|
||||
|
||||
|
||||
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 '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
|
||||
def test_survey_password_list(job_with_secret_key_unit):
|
||||
"""Verify that survey_password_variables method gives a list of survey passwords"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user