X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=lcm%2Flcm%2Fnf%2Ftests%2Ftest_create_vnf.py;h=66b1a2510ca1350a1a49db33a29e0401b1082dfb;hb=c9c20b831923443196e945a25ee16c3db7eafe5a;hp=afeedb31ff19f1a860d64876cdc05fc1dea786ac;hpb=a489d17eed5ffb2d8c2f60d959f868934b377977;p=vfc%2Fgvnfm%2Fvnflcm.git diff --git a/lcm/lcm/nf/tests/test_create_vnf.py b/lcm/lcm/nf/tests/test_create_vnf.py index afeedb31..66b1a251 100644 --- a/lcm/lcm/nf/tests/test_create_vnf.py +++ b/lcm/lcm/nf/tests/test_create_vnf.py @@ -18,7 +18,7 @@ import mock from django.test import TestCase from rest_framework import status from rest_framework.test import APIClient -from lcm.nf.const import vnfpackage_info +from .const import vnfpackage_info from lcm.pub.database.models import NfInstModel, JobStatusModel from lcm.pub.utils import restcall from lcm.pub.utils.timeutil import now_time @@ -62,7 +62,10 @@ class TestNFInstantiate(TestCase): response = self.client.post("/api/vnflcm/v1/vnf_instances", data=data, format='json') self.failUnlessEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code) context = json.loads(response.content) - self.assertEqual({'error': 'VNF is already exist.'}, context) + self.assertEqual({ + 'detail': 'VNF is already exist.', + 'status': 500 + }, context) @mock.patch.object(restcall, 'call_req') @mock.patch.object(uuid, 'uuid4') @@ -76,5 +79,11 @@ class TestNFInstantiate(TestCase): "vnfInstanceDescription": "vFW in Nanjing TIC Edge" } response = self.client.post("/api/vnflcm/v1/vnf_instances", data=data, format='json') - expect_data = {"id": "1", "vnfProvider": "huawei", "vnfdVersion": "1.0", "vnfPkgId": "111"} + expect_data = { + "id": "1", + "vnfProvider": "huawei", + "vnfdVersion": "1.0", + "vnfPkgId": "111", + "instantiationState": "NOT_INSTANTIATED" + } self.assertEqual(expect_data, response.data)