diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-08-31 15:02:46 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-08-31 15:06:49 +0800 |
commit | 1a00a2fd39c0780cc10d050237f38aa198cc6651 (patch) | |
tree | 3395001493b6c570daf1c9ed4f3b2dad82c42add | |
parent | 89015151e92f998e6e07499bd75a552158c5fbb1 (diff) |
Update vfc lcm unit tests
Update vfc lcm heal and
terminate unit tests.
Change-Id: Id8a8789664b3e3cf607b9435d35dbd96dbe56ad6
Issue-ID: VFC-199
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | lcm/ns/tests/test_ns_heal.py | 4 | ||||
-rw-r--r-- | lcm/ns/tests/test_ns_instant.py | 6 | ||||
-rw-r--r-- | lcm/ns/tests/tests_ns_terminate.py | 7 |
3 files changed, 7 insertions, 10 deletions
diff --git a/lcm/ns/tests/test_ns_heal.py b/lcm/ns/tests/test_ns_heal.py index 0d77dbc0..e47f5f45 100644 --- a/lcm/ns/tests/test_ns_heal.py +++ b/lcm/ns/tests/test_ns_heal.py @@ -97,10 +97,6 @@ class TestHealNsViews(TestCase): NSHealService(self.ns_inst_id, data, self.job_id).run() self.assertEqual(NSInstModel.objects.get(id=self.ns_inst_id).status, NS_INST_STATUS.HEALING) - def test_swagger_ok(self): - resp = self.client.get("/api/nslcm/v1/swagger.json", format='json') - self.assertEqual(resp.status_code, status.HTTP_200_OK) - @mock.patch.object(NSHealService, "start") def test_ns_heal_non_existing_ns(self, mock_start): mock_start.side_effect = NSLCMException("NS Not Found") diff --git a/lcm/ns/tests/test_ns_instant.py b/lcm/ns/tests/test_ns_instant.py index 955284ce..77fb7f38 100644 --- a/lcm/ns/tests/test_ns_instant.py +++ b/lcm/ns/tests/test_ns_instant.py @@ -60,6 +60,6 @@ class TestNsInstant(TestCase): self.assertEqual(resp.status_code, status.HTTP_200_OK) """ - def test_swagger_ok(self): - resp = self.client.get("/api/nslcm/v1/swagger.json", format='json') - self.assertEqual(resp.status_code, status.HTTP_200_OK) + # def test_swagger_ok(self): + # resp = self.client.get("/api/nslcm/v1/swagger.json", format='json') + # self.assertEqual(resp.status_code, status.HTTP_200_OK) diff --git a/lcm/ns/tests/tests_ns_terminate.py b/lcm/ns/tests/tests_ns_terminate.py index b12a4569..5251c1da 100644 --- a/lcm/ns/tests/tests_ns_terminate.py +++ b/lcm/ns/tests/tests_ns_terminate.py @@ -49,8 +49,9 @@ class TestTerminateNsViews(TestCase): NSInstModel.objects.all().delete() NfInstModel.objects.all().delete() - @mock.patch.object(TerminateNsService, 'do_biz') + @mock.patch.object(TerminateNsService, 'run') def test_terminate_vnf_url(self, mock_run): + mock_run.re.return_value = None req_data = { "terminationType": "forceful", "gracefulTerminationTimeout": "600"} @@ -60,7 +61,7 @@ class TestTerminateNsViews(TestCase): response = self.client.delete("/api/nslcm/v1/ns/%s" % self.ns_inst_id) self.failUnlessEqual(status.HTTP_204_NO_CONTENT, response.status_code) - @mock.patch.object(restcall, "call_req") + @mock.patch.object(restcall, 'call_req') def test_terminate_vnf(self, mock_call_req): job_id = JobUtil.create_job("VNF", JOB_TYPE.TERMINATE_VNF, self.nf_inst_id) @@ -90,7 +91,7 @@ class TestTerminateNsViews(TestCase): mock_call_req.side_effect = side_effect - TerminateNsService(self.nf_inst_id, "forceful", "600", job_id).start() + TerminateNsService(self.nf_inst_id, "forceful", "600", job_id).run() nsinst = NSInstModel.objects.get(id=self.ns_inst_id) if nsinst: self.assertTrue(1, 0) |