summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/resources/project_handlers.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources/project_handlers.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/project_handlers.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/project_handlers.py b/utils/test/testapi/opnfv_testapi/resources/project_handlers.py
index 9cf698623..f3521961d 100644
--- a/utils/test/testapi/opnfv_testapi/resources/project_handlers.py
+++ b/utils/test/testapi/opnfv_testapi/resources/project_handlers.py
@@ -6,23 +6,23 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+import handlers
+from opnfv_testapi.common import constants
from opnfv_testapi.tornado_swagger import swagger
-from handlers import GenericApiHandler
-from opnfv_testapi.common.constants import HTTP_FORBIDDEN
-from project_models import Project
+import project_models
-class GenericProjectHandler(GenericApiHandler):
+class GenericProjectHandler(handlers.GenericApiHandler):
def __init__(self, application, request, **kwargs):
super(GenericProjectHandler, self).__init__(application,
request,
**kwargs)
self.table = 'projects'
- self.table_cls = Project
+ self.table_cls = project_models.Project
class ProjectCLHandler(GenericProjectHandler):
- @swagger.operation(nickname="List all Projects")
+ @swagger.operation(nickname="listAllProjects")
def get(self):
"""
@description: list all projects
@@ -31,7 +31,7 @@ class ProjectCLHandler(GenericProjectHandler):
"""
self._list()
- @swagger.operation(nickname="Create a Project")
+ @swagger.operation(nickname="createProject")
def post(self):
"""
@description: create a project
@@ -48,7 +48,7 @@ class ProjectCLHandler(GenericProjectHandler):
def error(data):
message = '{} already exists as a project'.format(data.name)
- return HTTP_FORBIDDEN, message
+ return constants.HTTP_FORBIDDEN, message
miss_checks = ['name']
db_checks = [(self.table, False, query, error)]
@@ -56,7 +56,7 @@ class ProjectCLHandler(GenericProjectHandler):
class ProjectGURHandler(GenericProjectHandler):
- @swagger.operation(nickname='Get a Project by project_name')
+ @swagger.operation(nickname='getProjectByName')
def get(self, project_name):
"""
@description: get a single project by project_name
@@ -66,7 +66,7 @@ class ProjectGURHandler(GenericProjectHandler):
"""
self._get_one({'name': project_name})
- @swagger.operation(nickname="Update a Project by project_name")
+ @swagger.operation(nickname="updateProjectByName")
def put(self, project_name):
"""
@description: update a single project by project_name
@@ -82,7 +82,7 @@ class ProjectGURHandler(GenericProjectHandler):
db_keys = ['name']
self._update(query, db_keys)
- @swagger.operation(nickname='Delete a Project by project_name')
+ @swagger.operation(nickname='deleteProjectByName')
def delete(self, project_name):
"""
@description: delete a project by project_name