summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/opnfv_testapi/resources
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
commit34db68599c76b124c57d5ebd4d749e4829a57bea (patch)
tree3c0afadff523dab4e47f3a4fc5ba20eda32928fd /utils/test/result_collection_api/opnfv_testapi/resources
parentcdf0e83b6697d2ff75ba30b567ead5bcfea0fa25 (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 'utils/test/result_collection_api/opnfv_testapi/resources')
-rw-r--r--utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py b/utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py
index 44834fd63..fe2d71e5e 100644
--- a/utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py
+++ b/utils/test/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):