diff options
author | Alan Rominger <arominge@redhat.com> | 2023-03-20 20:26:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-20 20:26:34 +0100 |
commit | 28b1c622759ddb4deb0ea03f1b8bdc15a37ee87f (patch) | |
tree | f9f92724ed137f66ba49a51c884d82ef2738d45c /awx_collection/test | |
parent | Merge pull request #13693 from mabashian/12651-workflow-convergence (diff) | |
download | awx-28b1c622759ddb4deb0ea03f1b8bdc15a37ee87f.tar.xz awx-28b1c622759ddb4deb0ea03f1b8bdc15a37ee87f.zip |
Fix bug with awx collection manual type alias (#13671)
* Fix bug with manual type alias
* Add unit test for creating manual project with path
Diffstat (limited to 'awx_collection/test')
-rw-r--r-- | awx_collection/test/awx/test_project.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/awx_collection/test/awx/test_project.py b/awx_collection/test/awx/test_project.py index 2f8724566a..04ec05bbf7 100644 --- a/awx_collection/test/awx/test_project.py +++ b/awx_collection/test/awx/test_project.py @@ -27,6 +27,24 @@ def test_create_project(run_module, admin_user, organization, silence_warning): @pytest.mark.django_db +def test_create_manual_project(run_module, admin_user, organization, mocker): + mocker.patch('awx.main.models.projects.Project.get_local_path_choices', return_value=['foo_folder/']) + result = run_module( + 'project', + dict(name='foo', organization=organization.name, scm_type='manual', local_path='foo_folder/', wait=False), + admin_user, + ) + assert result.pop('changed', None), result + + proj = Project.objects.get(name='foo') + assert proj.local_path == 'foo_folder/' + assert proj.organization == organization + + result.pop('invocation') + assert result == {'name': 'foo', 'id': proj.id} + + +@pytest.mark.django_db def test_create_project_copy_from(run_module, admin_user, organization, silence_warning): '''Test the copy_from functionality''' result = run_module( |