diff options
author | maopengzhang <zhang.maopeng1@zte.com.cn> | 2019-03-30 15:27:41 +0800 |
---|---|---|
committer | maopengzhang <zhang.maopeng1@zte.com.cn> | 2019-03-30 15:27:41 +0800 |
commit | e8ff6a2b7b298264a4f8624c8112fa0a0f70aaea (patch) | |
tree | 101d75d79a9035525df22faa857c184736a2e563 | |
parent | 72463458c9ef9dbdd64d9da2b7eb675ed3a894d0 (diff) |
add occ in heal test case
add occ in heal test case
Change-Id: I4c986c01c6cc583567c4a374def53dd54d223041
Issue-ID: VFC-1059
Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
-rw-r--r-- | lcm/ns/tests/test_sol_ns_heal_api.py | 7 |
1 files changed, 6 insertions, 1 deletions
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): |