summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2019-04-23 09:24:14 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2019-04-23 09:24:14 +0800
commitb5d356713db3b4e3c662ea07dd96dc0b44b94548 (patch)
tree5753509da78b4fb62d9b4e05f6e0564d3d0beb74
parente0904a046f222082399d5d5e5518fe7aa297cb53 (diff)
Add chg ext conn ut case
Change-Id: I19c4d94b13950418f9e570f5d4ebee3e885b5c7a Issue-ID: VFC-1306 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/lcm/nf/tests/test_change_ext_conn.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/lcm/lcm/nf/tests/test_change_ext_conn.py b/lcm/lcm/nf/tests/test_change_ext_conn.py
index f91f2195..8f304d10 100644
--- a/lcm/lcm/nf/tests/test_change_ext_conn.py
+++ b/lcm/lcm/nf/tests/test_change_ext_conn.py
@@ -31,6 +31,16 @@ class TestChangeExtConn(TestCase):
version="V1",
package_id="2",
status='NOT_INSTANTIATED').save()
+ NfInstModel(nfinstid='123',
+ nf_name='VNF1',
+ nf_desc="VNF DESC",
+ vnfdid="1",
+ netype="XGW",
+ vendor="ZTE",
+ vnfSoftwareVersion="V1",
+ version="V1",
+ package_id="2",
+ status='INSTANTIATED').save()
self.req_data = {
"extVirtualLinks": [{
"id": "string",
@@ -69,6 +79,7 @@ class TestChangeExtConn(TestCase):
def tearDown(self):
NfInstModel.objects.filter(nfinstid='12345').delete()
+ NfInstModel.objects.filter(nfinstid='123').delete()
def test_change_ext_conn_not_found(self):
url = "/api/vnflcm/v1/vnf_instances/12/change_ext_conn"
@@ -83,3 +94,10 @@ class TestChangeExtConn(TestCase):
data=self.req_data,
format='json')
self.failUnlessEqual(status.HTTP_409_CONFLICT, response.status_code)
+
+ def test_change_ext_conn_inner_error(self):
+ url = "/api/vnflcm/v1/vnf_instances/123/change_ext_conn"
+ response = self.client.post(url,
+ data={},
+ format='json')
+ self.failUnlessEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code)