diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-02-27 01:21:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-02-27 01:21:33 +0000 |
commit | d707f05513d4fc9d0f58f1d777471307484b21bc (patch) | |
tree | 9ce34cd2e51f4856aa853552f3ad4d423ef9586a /testapi | |
parent | 7ac324f4b4bb2d190bf0888d12054663e095cc77 (diff) | |
parent | e2bbce72ca32d3bfdde04149b9d702b0a82d3279 (diff) |
Merge "set debug=False to prevent useless tracebacks"
Diffstat (limited to 'testapi')
-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' |