summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/resources/testcase_handlers.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-02-20 14:32:29 +0800
committerSerena Feng <feng.xiaowei@zte.com.cn>2017-02-21 03:09:59 +0000
commitfd9becfdd2ac98ad55541987a2104ab46ca8fc99 (patch)
tree90c37c9a854b1e60c1d3234a7483810f7bf4048b /testapi/opnfv_testapi/resources/testcase_handlers.py
parent5b0a40fe23993b7a799279290dabe767c2702bd6 (diff)
fix violation of import rule in TestAPI
TestAPI violate import rule of OpenStack Style a lot, like Do not import objects, only modules Do not import more than one module per line Alphabetically order your imports by the full module path This patch is mean to fix them. Change-Id: Ia05b944a74b3f443c9101a9840f613f9a6f5ae49 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/resources/testcase_handlers.py')
-rw-r--r--testapi/opnfv_testapi/resources/testcase_handlers.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/testapi/opnfv_testapi/resources/testcase_handlers.py b/testapi/opnfv_testapi/resources/testcase_handlers.py
index 100a4fd..3debd69 100644
--- a/testapi/opnfv_testapi/resources/testcase_handlers.py
+++ b/testapi/opnfv_testapi/resources/testcase_handlers.py
@@ -6,19 +6,19 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-from opnfv_testapi.common.constants import HTTP_FORBIDDEN
-from opnfv_testapi.resources.handlers import GenericApiHandler
-from opnfv_testapi.resources.testcase_models import Testcase
+from opnfv_testapi.common import constants
+from opnfv_testapi.resources import handlers
+from opnfv_testapi.resources import testcase_models
from opnfv_testapi.tornado_swagger import swagger
-class GenericTestcaseHandler(GenericApiHandler):
+class GenericTestcaseHandler(handlers.GenericApiHandler):
def __init__(self, application, request, **kwargs):
super(GenericTestcaseHandler, self).__init__(application,
request,
**kwargs)
self.table = self.db_testcases
- self.table_cls = Testcase
+ self.table_cls = testcase_models.Testcase
class TestcaseCLHandler(GenericTestcaseHandler):
@@ -58,12 +58,12 @@ class TestcaseCLHandler(GenericTestcaseHandler):
def p_error(data):
message = 'Could not find project [{}]'.format(data.project_name)
- return HTTP_FORBIDDEN, message
+ return constants.HTTP_FORBIDDEN, message
def tc_error(data):
message = '{} already exists as a testcase in project {}'\
.format(data.name, data.project_name)
- return HTTP_FORBIDDEN, message
+ return constants.HTTP_FORBIDDEN, message
miss_checks = ['name']
db_checks = [(self.db_projects, True, p_query, p_error),