Add test for deploy result get one 11/52011/2
authorthuva4 <tharma.thuva@gmail.com>
Sun, 11 Feb 2018 09:37:37 +0000 (15:07 +0530)
committerthuva4 <tharma.thuva@gmail.com>
Thu, 15 Feb 2018 12:07:04 +0000 (17:37 +0530)
Cover the deploy result get one function & not found in
unit test

JIRA: RELENG-345

Change-Id: I45e9c9c4feacc73d2c934031656ac063be42a148
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py

index 65e765e..8f2ca76 100644 (file)
@@ -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))