Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred-sun committed Apr 8, 2021
1 parent 1dbbd62 commit ca7d936
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 26 deletions.
1 change: 1 addition & 0 deletions plugins/modules/azure_rm_apimanagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ def get_resource(self):
30,
)
isFound = True
response = json.loads(response.text)
self.log("Response : {0}".format(response))
except CloudError as e:
self.log('Could not find the Api instance from the given parameters.')
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/targets/azure_rm_apimanagement/aliases
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cloud/azure
shippable/azure/group3
shippable/azure/group10
destructive
disabled
33 changes: 12 additions & 21 deletions tests/integration/targets/azure_rm_apimanagement/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
- name: Fix resource prefix
set_fact:
name: "myPolicy{{ resource_group | hash('md5') | truncate(22, True, '') }}"
service_name: "myService"
api_id: "myPolicy{{ resource_group | hash('md5') | truncate(22, True, '') }}"
service_name: "myServuce{{ resource_group | hash('md5') | truncate(22, True, '') }}"

- name: create API management service
azure_rm_apimanagementservice:
resource_group: "{{ resource_group }}"
name: "{{ service_name }}"
publisher_email: user@example.com
publisher_name: Username
sku_name: Developer
sku_capacity: 1

- name: Create a new API instance
azure_rm_apimanagement:
Expand Down Expand Up @@ -39,7 +48,7 @@
assert:
that:
- newApi_idempotent.changed == False
- newApi_idempotent.failed == True
- newApi_idempotent.failed == False

- name: Create different format api
azure_rm_apimanagement:
Expand All @@ -57,24 +66,6 @@
- newOpenApi.changed == True
- newOpenApi.failed == False

- name: Test creating api without the path parameter
azure_rm_apimanagement:
resource_group: "{{ resource_group }}"
service_name: "{{ service_name }}"
api_id: "{{ api_id }}"
description: "testDescription"
display_name: "TestAPI"
service_url: 'http://testapi.example.net/api'
protocols:
- https
register: noPath

- name: Assert that output throws an error
assert:
that:
- noPath.changed == False
- noPath.failed == True

- name: Delete an api
azure_rm_apimanagement:
resource_group: "{{ resource_group }}"
Expand Down
4 changes: 0 additions & 4 deletions tests/sanity/ignore-2.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ plugins/modules/azure_rm_aksversion_info.py validate-modules:parameter-type-not-
plugins/modules/azure_rm_appgateway.py validate-modules:doc-choices-do-not-match-spec
plugins/modules/azure_rm_appgateway.py validate-modules:parameter-type-not-in-doc
plugins/modules/azure_rm_apimanagement.py validate-modules:doc-choices-do-not-match-spec
plugins/modules/azure_rm_apimanagement.py validate-modules:doc-default-does-not-match-spec
plugins/modules/azure_rm_apimanagement.py validate-modules:missing-suboption-docs
plugins/modules/azure_rm_apimanagement.py validate-modules:parameter-type-not-in-doc
plugins/modules/azure_rm_apimanagement.py validate-modules:undocumented-parameter
plugins/modules/azure_rm_applicationsecuritygroup.py validate-modules:parameter-type-not-in-doc
plugins/modules/azure_rm_applicationsecuritygroup_info.py validate-modules:parameter-type-not-in-doc
plugins/modules/azure_rm_appserviceplan.py validate-modules:parameter-type-not-in-doc
Expand Down

0 comments on commit ca7d936

Please sign in to comment.