Add extra_vars example to Job Launch module, update extra_vars type to dict,

update unit test, add details to Collections release notes.
This commit is contained in:
beeankha
2019-12-20 13:56:12 -05:00
parent 1c09114abd
commit f37ac1dcc9
3 changed files with 39 additions and 5 deletions

View File

@@ -42,17 +42,23 @@ def test_job_launch_with_prompting(run_module, admin_user, project, inventory, m
name='foo',
project=project,
playbook='helloworld.yml',
ask_variables_on_launch=True,
ask_inventory_on_launch=True,
ask_credential_on_launch=True
)
result = run_module('tower_job_launch', dict(
job_template='foo',
inventory=inventory.name,
credential=machine_credential.name
credential=machine_credential.name,
extra_vars={"var1": "My First Variable",
"var2": "My Second Variable",
"var3": "My Third Variable"
}
), admin_user)
assert result.pop('changed', None), result
job = Job.objects.get(id=result['id'])
assert job.extra_vars == '{"var1": "My First Variable", "var2": "My Second Variable", "var3": "My Third Variable"}'
assert job.inventory == inventory
assert [cred.id for cred in job.credentials.all()] == [machine_credential.id]