awx/awx_collection/test/awx/test_project.py
beeankha eff46dbc71 Make playbook wait for project sync...
...*before* running the associated job template.

Set "wait" default to True so CI doesn't time out

Change default back to "False", put in new "if"...

...block, explicitly set "wait" to "False" in test file.

Change if block

Update README

Update 'wait' option description
2019-11-20 08:43:19 -05:00

30 lines
756 B
Python

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
from awx.main.models import Project
@pytest.mark.django_db
def test_create_project(run_module, admin_user, organization):
result = run_module('tower_project', dict(
name='foo',
organization=organization.name,
scm_type='git',
scm_url='https://foo.invalid',
wait=False
), admin_user)
assert result.pop('changed', None), result
proj = Project.objects.get(name='foo')
assert proj.scm_url == 'https://foo.invalid'
assert proj.organization == organization
result.pop('invocation')
assert result == {
'id': proj.id,
'project': 'foo',
'state': 'present'
}