diff options
author | 2017-04-05 16:23:03 +0800 | |
---|---|---|
committer | 2017-04-06 16:55:21 +0800 | |
commit | aa823fd3bbe42ead475217e2a5b947a636cf63dd (patch) | |
tree | 68e9e80dae6bb6325de2d8a839ee9d5fe6055ca6 /utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py | |
parent | 5412a1b30129d25b6f7f7de6c5262e2e3edc699b (diff) |
unify error message in TestAPI
Change-Id: I994feb7bf340c9e48bebe9fdf3dc3a76bc254652
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.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py b/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py index 1211a0573..bc22b74e2 100644 --- a/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py @@ -8,6 +8,7 @@ ############################################################################## import httplib +from opnfv_testapi.common import message from opnfv_testapi.resources import handlers from opnfv_testapi.resources import testcase_models from opnfv_testapi.tornado_swagger import swagger @@ -58,13 +59,11 @@ class TestcaseCLHandler(GenericTestcaseHandler): } def p_error(data): - message = 'Could not find project [{}]'.format(data.project_name) - return httplib.FORBIDDEN, message + return httplib.FORBIDDEN, message.not_found('project', + data.project_name) def tc_error(data): - message = '{} already exists as a testcase in project {}'\ - .format(data.name, data.project_name) - return httplib.FORBIDDEN, message + return httplib.FORBIDDEN, message.exist('testcase', data.name) miss_checks = ['name'] db_checks = [(self.db_projects, True, p_query, p_error), |