summaryrefslogtreecommitdiffstats
path: root/result_collection_api/opnfv_testapi/resources/result_handlers.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-06-06 16:12:36 +0800
committerSerena Feng <feng.xiaowei@zte.com.cn>2016-06-06 08:17:41 +0000
commit11cd92c210b3ee1099fb2f91e80fbb989d385491 (patch)
treef23f0f15bb373bb8531f682afac1397bd1adfde4 /result_collection_api/opnfv_testapi/resources/result_handlers.py
parent5eb8d87e563503b0cf67746e34f6f6038c567a72 (diff)
add unittest for 'last' query of results in testAPI
add 'last' related unittest in test_result.py implement sort()&limit() in fake_pymongo.py refactor 'sort' model in result_handlers.py JIRA: FUNCTEST-296 Change-Id: Ib5371f1df67f170e3ba26c6da27a651e34f2b0d6 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'result_collection_api/opnfv_testapi/resources/result_handlers.py')
-rw-r--r--result_collection_api/opnfv_testapi/resources/result_handlers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/result_collection_api/opnfv_testapi/resources/result_handlers.py b/result_collection_api/opnfv_testapi/resources/result_handlers.py
index 44834fd..fe2d71e 100644
--- a/result_collection_api/opnfv_testapi/resources/result_handlers.py
+++ b/result_collection_api/opnfv_testapi/resources/result_handlers.py
@@ -29,7 +29,7 @@ class GenericResultHandler(GenericApiHandler):
try:
value = int(value)
except:
- raise HTTPError(HTTP_BAD_REQUEST, '{} must be int', key)
+ raise HTTPError(HTTP_BAD_REQUEST, '{} must be int'.format(key))
return value
def set_query(self):
@@ -125,7 +125,7 @@ class ResultsCLHandler(GenericResultHandler):
if last is not None:
last = self.get_int('last', last)
- self._list(self.set_query(), sort=[{'start_date', -1}], last=last)
+ self._list(self.set_query(), sort=[('start_date', -1)], last=last)
@swagger.operation(nickname="create")
def post(self):