diff options
author | Fu Jinhua <fu.jinhua@zte.com.cn> | 2018-03-06 06:29:57 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-06 06:29:57 +0000 |
commit | 7c1f31143d6fe8db3f732389953db2405318bf6f (patch) | |
tree | 75611b7aab165e1fcf1663159e5231c3327a3ee2 | |
parent | 412cc113a99fd44ef6b5808681bfc487b4c86904 (diff) | |
parent | 3cc9b3951c5c035252c73831abf7c824bdcaef8a (diff) |
Merge "Add a new test case"
-rw-r--r-- | lcm/pub/tests/test_scaleaspect.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lcm/pub/tests/test_scaleaspect.py b/lcm/pub/tests/test_scaleaspect.py index 8e446ffb..01571f14 100644 --- a/lcm/pub/tests/test_scaleaspect.py +++ b/lcm/pub/tests/test_scaleaspect.py @@ -4,6 +4,7 @@ from lcm.pub.utils.scaleaspect import get_vnf_scale_info_package from lcm.pub.utils.scaleaspect import get_vnf_data_package from lcm.pub.utils.scaleaspect import get_json_data from lcm.pub.utils.scaleaspect import get_nsdId +from lcm.pub.utils.scaleaspect import deal_vnf_scale_info from lcm.pub.database.models import NfInstModel from lcm.pub.database.models import NSInstModel from lcm.pub.msapi import catalog @@ -127,6 +128,29 @@ class TestScaleAspect(TestCase): self.assertIsNotNone(scale_vnf_data) self.assertEqual(2, scale_vnf_data.__len__()) + def test_deal_vnf_scale_info(self): + vnf_scale_info_list = [ + { + "vnfd_id": "nf_zte_cscf", + "vnf_scaleAspectId": "mpu", + "numberOfSteps": "1" + }, + { + "vnfd_id": "nf_zte_hss", + "vnf_scaleAspectId": "mpu", + "numberOfSteps": "1" + } + ] + result = deal_vnf_scale_info(vnf_scale_info_list) + self.assertEqual(result[0]["numberOfSteps"], vnf_scale_info_list[0]["numberOfSteps"]) + self.assertEqual(result[0]["vnf_scaleAspectId"], vnf_scale_info_list[0]["vnf_scaleAspectId"]) + self.assertEqual(result[1]["numberOfSteps"], vnf_scale_info_list[0]["numberOfSteps"]) + self.assertEqual(result[1]["vnf_scaleAspectId"], vnf_scale_info_list[0]["vnf_scaleAspectId"]) + self.assertEqual("231", result[0]["vnfInstanceId"]) + self.assertEqual("232", result[1]["vnfInstanceId"]) + self.assertNotIn("vnfd_id", result[0]) + self.assertNotIn("vnfd_id", result[1]) + def test_get_nsdId(self): nsd_id = get_nsdId("1") self.assertEqual("23", nsd_id) |