From 89e8f8355372a9c377ae887c855bd6c752aad2e1 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Sun, 11 Feb 2018 15:07:37 +0530 Subject: Add test for deploy result get one Cover the deploy result get one function & not found in unit test JIRA: RELENG-345 Change-Id: I45e9c9c4feacc73d2c934031656ac063be42a148 Signed-off-by: thuva4 --- .../tests/unit/handlers/test_deploy_result.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'testapi/opnfv_testapi/tests/unit') diff --git a/testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py b/testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py index 65e765e..8f2ca76 100644 --- a/testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py +++ b/testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py @@ -92,6 +92,10 @@ class DeployResultGet(DeployResultBase): self.req_d_id = self._create_d() self.req_10d_later = self._create_changed_date(days=10) + @executor.get(httplib.OK, 'assert_res') + def test_getOne(self): + return self.req_d_id + @executor.query(httplib.OK, '_query_success', 3) def test_queryInstaller(self): return self._set_query('installer') @@ -165,6 +169,19 @@ class DeployResultGet(DeployResultBase): self._create_error_start_date('') return self._set_query(period=5) + @executor.query(httplib.OK, '_query_success', 0) + def test_notFound(self): + return self._set_query('installer', + 'version', + 'job_name', + 'build_id', + 'scenario', + 'upstream_job_name', + 'upstream_build_id', + 'criteria', + pod='notExistPod', + period=1) + def _query_success(self, body, number): self.assertEqual(number, len(body.deployresults)) -- cgit 1.2.3-korg