diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2018-02-24 16:46:51 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2018-02-26 10:03:35 +0800 |
commit | e2bbce72ca32d3bfdde04149b9d702b0a82d3279 (patch) | |
tree | 1ef006183cefd9c6e16ae9fb9a46839d7f9fd2dd | |
parent | e9285f3bb3f71840958e8967ba6409dc9b2d038a (diff) |
set debug=False to prevent useless tracebacks
Change-Id: Ide0e00e3aa6ee4a484fd9d1b7c9bc52b598267ea
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
-rw-r--r-- | testapi/etc/config.ini | 2 | ||||
-rw-r--r-- | testapi/opnfv_testapi/handlers/result_handlers.py | 2 | ||||
-rw-r--r-- | testapi/opnfv_testapi/tests/unit/common/test_config.py | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/testapi/etc/config.ini b/testapi/etc/config.ini index 86cb0ca..5f568a7 100644 --- a/testapi/etc/config.ini +++ b/testapi/etc/config.ini @@ -15,7 +15,7 @@ port = 8000 results_per_page = 20 # With debug_on set to true, error traces will be shown in HTTP responses -debug = True +debug = False token_check = False authenticate = True diff --git a/testapi/opnfv_testapi/handlers/result_handlers.py b/testapi/opnfv_testapi/handlers/result_handlers.py index b0691cd..2d4280f 100644 --- a/testapi/opnfv_testapi/handlers/result_handlers.py +++ b/testapi/opnfv_testapi/handlers/result_handlers.py @@ -245,6 +245,8 @@ class ResultsUploadHandler(ResultsCLHandler): @raise 400: body/pod_name/project_name/case_name not provided """ logging.info('file upload') + if not self.request.files: + raises.NotFound(message.key_error('file')) fileinfo = self.request.files['file'][0] is_public = self.get_body_argument('public') logging.warning('public:%s', is_public) diff --git a/testapi/opnfv_testapi/tests/unit/common/test_config.py b/testapi/opnfv_testapi/tests/unit/common/test_config.py index 6d160ce..8e4966f 100644 --- a/testapi/opnfv_testapi/tests/unit/common/test_config.py +++ b/testapi/opnfv_testapi/tests/unit/common/test_config.py @@ -11,7 +11,7 @@ def test_config_normal(mocker, config_normal): assert CONF.mongo_url == 'mongodb://127.0.0.1:27017/' assert CONF.mongo_dbname == 'test_results_collection' assert CONF.api_port == 8000 - assert CONF.api_debug is True + assert CONF.api_debug is False assert CONF.api_token_check is False assert CONF.api_authenticate is True assert CONF.ui_url == 'http://localhost:8000' |