diff options
author | 2016-05-31 20:44:03 +0800 | |
---|---|---|
committer | 2016-05-31 20:45:57 +0800 | |
commit | c6ace67b6c587663dd83b5aa6afb126380e16678 (patch) | |
tree | 76febbcad1ea4cd5da1043e35a3895350c945abe /result_collection_api/tests/unit/test_result.py | |
parent | cd68f499572ae87b1aa3213a389c8931a7035387 (diff) |
bugfix: query results failed due to wrong using type of trust_indicator
trust_indicator must be int/long/float rather than string
JIRA: FUNCTEST-280
Change-Id: I2e2b292f9181fd28896bfe1e3b86ec3976b65016
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'result_collection_api/tests/unit/test_result.py')
-rw-r--r-- | result_collection_api/tests/unit/test_result.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/result_collection_api/tests/unit/test_result.py b/result_collection_api/tests/unit/test_result.py index 7829d7c..7b1f976 100644 --- a/result_collection_api/tests/unit/test_result.py +++ b/result_collection_api/tests/unit/test_result.py @@ -79,9 +79,10 @@ class TestResultBase(TestBase): self.req_testcase, self.project) - def assert_res(self, code, result): + def assert_res(self, code, result, req=None): self.assertEqual(code, HTTP_OK) - req = self.req_d + if req is None: + req = self.req_d self.assertEqual(result.pod_name, req.pod_name) self.assertEqual(result.project_name, req.project_name) self.assertEqual(result.case_name, req.case_name) @@ -96,8 +97,8 @@ class TestResultBase(TestBase): self.assertEqual(result.scenario, req.scenario) self.assertEqual(result.criteria, req.criteria) self.assertEqual(result.trust_indicator, req.trust_indicator) - self.assertIsNotNone(result.start_date) - self.assertIsNotNone(result.stop_date) + self.assertEqual(result.start_date, req.start_date) + self.assertEqual(result.stop_date, req.stop_date) self.assertIsNotNone(result._id) @@ -233,8 +234,8 @@ class TestResultGet(TestResultBase): self.assertEqual(code, HTTP_OK) self.assertEqual(0, len(body.results)) else: + self.assertEqual(1, len(body.results)) for result in body.results: - self.assertEqual(1, len(body.results)) self.assert_res(code, result) def _set_query(self, *args): |