summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authoryunlong ying <ying.yunlong@zte.com.cn>2019-04-09 03:35:26 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-09 03:35:26 +0000
commit25c99551231133280eabc5467b9e3740b41b93b2 (patch)
tree1fdf5c74290b29676aa6c3b06ae7d4f2a21f4ee1 /lcm
parent41275b60f7a38d0bb20df57f4e34386e7783630d (diff)
parent4f15ab27a6d789c98c0453287ca2dd0a623e5384 (diff)
Merge "Add test case for scale vnf"
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/tests/test_scale_vnf.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/lcm/lcm/nf/tests/test_scale_vnf.py b/lcm/lcm/nf/tests/test_scale_vnf.py
index 0024840c..46cc0c2e 100644
--- a/lcm/lcm/nf/tests/test_scale_vnf.py
+++ b/lcm/lcm/nf/tests/test_scale_vnf.py
@@ -15,17 +15,29 @@ from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
+from lcm.pub.database.models import NfInstModel
+
class TestNfScale(TestCase):
def setUp(self):
self.client = APIClient()
+ NfInstModel(nfinstid='12345',
+ nf_name='VNF1',
+ nf_desc="VNF DESC",
+ vnfdid="1",
+ netype="XGW",
+ vendor="ZTE",
+ vnfSoftwareVersion="V1",
+ version="V1",
+ package_id="2",
+ status='NOT_INSTANTIATED').save()
self.req_data = {
"type": "SCALE_IN",
"aspectId": "sunshine_aspect"
}
def tearDown(self):
- pass
+ NfInstModel.objects.filter(nfinstid='12345').delete()
def test_scale_vnf_not_found(self):
url = "/api/vnflcm/v1/vnf_instances/12/scale"
@@ -33,3 +45,10 @@ class TestNfScale(TestCase):
data=self.req_data,
format='json')
self.failUnlessEqual(status.HTTP_404_NOT_FOUND, response.status_code)
+
+ def test_scale_vnf_conflict(self):
+ url = "/api/vnflcm/v1/vnf_instances/12345/scale"
+ response = self.client.post(url,
+ data=self.req_data,
+ format='json')
+ self.failUnlessEqual(status.HTTP_409_CONFLICT, response.status_code)