From e8ff6a2b7b298264a4f8624c8112fa0a0f70aaea Mon Sep 17 00:00:00 2001 From: maopengzhang Date: Sat, 30 Mar 2019 15:27:41 +0800 Subject: add occ in heal test case add occ in heal test case Change-Id: I4c986c01c6cc583567c4a374def53dd54d223041 Issue-ID: VFC-1059 Signed-off-by: maopengzhang --- lcm/ns/tests/test_sol_ns_heal_api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lcm/ns/tests/test_sol_ns_heal_api.py b/lcm/ns/tests/test_sol_ns_heal_api.py index 8ff4ced5..adb8c1ec 100644 --- a/lcm/ns/tests/test_sol_ns_heal_api.py +++ b/lcm/ns/tests/test_sol_ns_heal_api.py @@ -13,6 +13,7 @@ # limitations under the License. import json +import uuid import mock from django.test import Client @@ -28,7 +29,7 @@ from lcm.pub.utils.jobutil import JobUtil, JOB_TYPE class TestHealNsApi(TestCase): def setUp(self): self.url = "/api/nslcm/v1/ns_instances/%s/heal" - self.ns_inst_id = '1' + self.ns_inst_id = str(uuid.uuid4()) self.nf_inst_id = '1' self.nf_uuid = '1-1-1' @@ -93,6 +94,8 @@ class TestHealNsApi(TestCase): self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.data) self.assertIsNotNone(response.data) self.assertIsNotNone(response['Location']) + response = self.client.get(response['Location'], format='json') + self.assertEqual(response.status_code, status.HTTP_200_OK) # add healNsData @@ -117,6 +120,8 @@ class TestHealNsApi(TestCase): response = self.client.post(self.url % self.ns_inst_id, data=data) self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.data) self.assertIsNotNone(response['Location']) + response = self.client.get(response['Location'], format='json') + self.assertEqual(response.status_code, status.HTTP_200_OK) @mock.patch.object(NSHealService, "start") def test_heal_vnf_non_existing_ns(self, mock_start): -- cgit 1.2.3-korg