summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-30 14:01:30 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-30 14:01:30 +0800
commit6f84a256bbe92cf3f9f746ca0972abd9942bad43 (patch)
tree446ad11476e9b7ced879aea4b2061d4721e71a34 /utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py
parent8d56e29f3dd1fad74a678202a70eb9d8bbf00bfc (diff)
replace self-defined http codes with standard definitions
Change-Id: I3045dc690e0bc1186f5c548cb533462dd03130d9 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py b/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py
index 3debd6918..1211a0573 100644
--- a/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py
+++ b/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py
@@ -6,7 +6,8 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-from opnfv_testapi.common import constants
+import httplib
+
from opnfv_testapi.resources import handlers
from opnfv_testapi.resources import testcase_models
from opnfv_testapi.tornado_swagger import swagger
@@ -58,12 +59,12 @@ class TestcaseCLHandler(GenericTestcaseHandler):
def p_error(data):
message = 'Could not find project [{}]'.format(data.project_name)
- return constants.HTTP_FORBIDDEN, message
+ return httplib.FORBIDDEN, message
def tc_error(data):
message = '{} already exists as a testcase in project {}'\
.format(data.name, data.project_name)
- return constants.HTTP_FORBIDDEN, message
+ return httplib.FORBIDDEN, message
miss_checks = ['name']
db_checks = [(self.db_projects, True, p_query, p_error),