diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-09-23 10:02:14 +0800 |
---|---|---|
committer | yunlong ying <ying.yunlong@zte.com.cn> | 2017-09-23 02:24:36 +0000 |
commit | 9f52da62cbc61f5443582adb75ac98692bc0d1ed (patch) | |
tree | f78db7569248bb84c5301ff40835cbd346415497 /gvnfmadapter | |
parent | 473fcf4ec62514c6ca255a8db89a73d650d07692 (diff) |
Fix vfc-gvnfmadapter unit tests.
Change-Id: I21a4dfd6961c2fe0dee9bf3a6259f4b350061798
Issue-ID: VFC-438
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'gvnfmadapter')
-rw-r--r-- | gvnfmadapter/driver/interfaces/tests.py | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/gvnfmadapter/driver/interfaces/tests.py b/gvnfmadapter/driver/interfaces/tests.py index 090cda9..8f0c2ad 100644 --- a/gvnfmadapter/driver/interfaces/tests.py +++ b/gvnfmadapter/driver/interfaces/tests.py @@ -270,28 +270,34 @@ class InterfacesTest(TestCase): "interfaceInfo": { "vimType": "vnf", "apiVersion": "v1", - "protocolType": "None"}, + "protocolType": "None" + }, "accessInfo": { "tenant": "tenant1", "username": "admin", - "password": "password"}, + "password": "password" + }, "interfaceEndpoint": "http://127.0.0.1/api/v1" }, "zone": "", "addResource": { "resourceDefinitionId": "xxxxx", "vimId": "12345678", - "zoneId": "000"}, + "zoneId": "000" + }, "removeResource": "", "vimAssets": { "computeResourceFlavour": { "vimId": "12345678", "vduId": "sdfasdf", - "vimFlavourId": "12"}, + "vimFlavourId": "12" + }, "softwareImage": { "vimId": "12345678", "imageName": "AAA", - "vimImageId": ""}}, + "vimImageId": "" + } + }, "additionalParam": "" } r2 = [0, json.JSONEncoder().encode(vim_info), "200"] @@ -303,17 +309,22 @@ class InterfacesTest(TestCase): "timestamp": "1234567890", "vnfinstanceid": "1", "eventtype": "0", - "vmlist": - [ - { - "vmflavor": "SMP", - "vmnumber": "3", - "vmidlist ": ["vmuuid"]}, - { - "vmflavor": "CMP", - "vmnumber": "3", - "vmidlist ": ["vmuuid"]} - ] + "vmlist": [ + { + "vmflavor": "SMP", + "vmnumber": "3", + "vmidlist ": [ + "vmuuid" + ] + }, + { + "vmflavor": "CMP", + "vmnumber": "3", + "vmidlist ": [ + "vmuuid" + ] + } + ] } response = self.client.post("/api/gvnfmdriver/v1/vnfs/lifecyclechangesnotification", data=json.dumps(req_data), @@ -324,12 +335,13 @@ class InterfacesTest(TestCase): @mock.patch.object(restcall, 'call_req') def test_get_vnfpkgs(self, mock_call_req): - mock_call_req.return_value = [0, json.JSONEncoder().encode({ + vnfpkgs_info = { "csars": [{ "csarId": "1", "vnfdId": "2" }] - }), '200'] + } + mock_call_req.return_value = [0, json.JSONEncoder().encode(vnfpkgs_info), '200'] resp = self.client.get("/api/gvnfmdriver/v1/vnfpackages") self.assertEqual(status.HTTP_200_OK, resp.status_code) self.assertEqual(1, len(resp.data["csars"])) |