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:
jainnikhil30
2019-01-09 20:01:21 +05:30
committed by René Moser
parent d84e21dfc8
commit cd27982959
27 changed files with 168 additions and 19 deletions

View File

@@ -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'"