add occ in heal test case 84/83784/1
authormaopengzhang <zhang.maopeng1@zte.com.cn>
Sat, 30 Mar 2019 07:27:41 +0000 (15:27 +0800)
committermaopengzhang <zhang.maopeng1@zte.com.cn>
Sat, 30 Mar 2019 07:27:41 +0000 (15:27 +0800)
add occ in heal test case

Change-Id: I4c986c01c6cc583567c4a374def53dd54d223041
Issue-ID: VFC-1059
Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
lcm/ns/tests/test_sol_ns_heal_api.py

index 8ff4ced..adb8c1e 100644 (file)
@@ -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):