mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fixing exception import for tower modules (#50447)
* fixing the exception import from tower modules * Adding tests for checking tower modules are failing with correct msg * fixed failing tests * fixed failing test in tower_team
This commit is contained in:
@@ -76,3 +76,31 @@
|
||||
- assert:
|
||||
that:
|
||||
- "multi_org_cred_project is changed"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_project:
|
||||
name: TestProject
|
||||
organization: Non Existing Org
|
||||
scm_type: git
|
||||
scm_url: "https://github.com/ansible/ansible"
|
||||
scm_credential: TestCred1
|
||||
register: result
|
||||
ignore_errors: true
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.msg == 'Failed to update project, organization not found: Non Existing Org'"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_project:
|
||||
name: TestProject
|
||||
organization: TestOrg1
|
||||
scm_type: git
|
||||
scm_url: "https://github.com/ansible/ansible"
|
||||
scm_credential: Non Existing Credential
|
||||
register: result
|
||||
ignore_errors: true
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.msg =='Failed to update project, credential not found: Non Existing Credential'"
|
||||
Reference in New Issue
Block a user