API Tempest tests on Action plans

This patchset adds CRUD tests on Action Plans via the API.

Partially Implements: blueprint tempest-basic-set-up

Change-Id: I8ff3c3f0dbf7d301be2e3f401edf24bca44914bd
This commit is contained in:
Vincent Françoise
2016-01-15 15:40:59 +01:00
parent 6d0754bb65
commit a16351d352
3 changed files with 255 additions and 2 deletions

View File

@@ -185,4 +185,51 @@ class InfraOptimClientJSON(base.BaseInfraOptimClient):
:return: Tuple with the server response and the updated audit
"""
return self._patch_request('audits', uuid, patch)
return self._patch_request('audits', audit_uuid, patch)
# ### ACTION PLANS ### #
@base.handle_errors
def list_action_plans(self, **kwargs):
"""List all existing action plan"""
return self._list_request('action_plans', **kwargs)
@base.handle_errors
def list_action_plans_detail(self, **kwargs):
"""Lists details of all existing action plan"""
return self._list_request('/action_plans/detail', **kwargs)
@base.handle_errors
def list_action_plan_by_audit(self, audit_uuid):
"""Lists all action plans associated with an audit"""
return self._list_request('/action_plans', audit_uuid=audit_uuid)
@base.handle_errors
def show_action_plan(self, action_plan_uuid):
"""Gets a specific action plan
:param action_plan_uuid: Unique identifier of the action plan
:return: Serialized action plan as a dictionary
"""
return self._show_request('/action_plans', action_plan_uuid)
@base.handle_errors
def delete_action_plan(self, action_plan_uuid):
"""Deletes an action_plan having the specified UUID
:param action_plan_uuid: The unique identifier of the action_plan
:return: A tuple with the server response and the response body
"""
return self._delete_request('/action_plans', action_plan_uuid)
@base.handle_errors
def update_action_plan(self, action_plan_uuid, patch):
"""Update the specified action plan
:param action_plan_uuid: The unique identifier of the action_plan
:param patch: List of dicts representing json patches.
:return: Tuple with the server response and the updated action_plan
"""
return self._patch_request('/action_plans', action_plan_uuid, patch)