summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi
diff options
context:
space:
mode:
authorSerena Feng <feng.xiaowei@zte.com.cn>2018-02-27 01:21:33 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-02-27 01:21:33 +0000
commitd707f05513d4fc9d0f58f1d777471307484b21bc (patch)
tree9ce34cd2e51f4856aa853552f3ad4d423ef9586a /testapi/opnfv_testapi
parent7ac324f4b4bb2d190bf0888d12054663e095cc77 (diff)
parente2bbce72ca32d3bfdde04149b9d702b0a82d3279 (diff)
Merge "set debug=False to prevent useless tracebacks"
Diffstat (limited to 'testapi/opnfv_testapi')
-rw-r--r--testapi/opnfv_testapi/handlers/result_handlers.py2
-rw-r--r--testapi/opnfv_testapi/tests/unit/common/test_config.py2
2 files changed, 3 insertions, 1 deletions
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'