summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2019-04-11 14:05:23 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2019-04-11 14:05:23 +0800
commita759abc3e8fe796f2e2137862583fdd6aa0e3e8b (patch)
tree90554e83f422ebc0c5ab381fcebff6bed90e6d99 /lcm
parentb92d2628810369f70705737e12100ac246b7278a (diff)
Add ut cases for scale vnf to level
Change-Id: I4fef278a509d76cd594920f3f1b4e093f957a1ba Issue-ID: VFC-1306 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/tests/test_scale_vnf_to_level.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/lcm/lcm/nf/tests/test_scale_vnf_to_level.py b/lcm/lcm/nf/tests/test_scale_vnf_to_level.py
index c4298d85..36eeba41 100644
--- a/lcm/lcm/nf/tests/test_scale_vnf_to_level.py
+++ b/lcm/lcm/nf/tests/test_scale_vnf_to_level.py
@@ -15,6 +15,8 @@ from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
+from lcm.pub.database.models import NfInstModel
+
class TestNfScaleToLevel(TestCase):
def setUp(self):
@@ -23,9 +25,19 @@ class TestNfScaleToLevel(TestCase):
"instantiationLevelId": "instantiation_level_2",
"scaleInfo": []
}
+ NfInstModel(nfinstid='98765',
+ nf_name='VNF1',
+ nf_desc="VNF DESC",
+ vnfdid="1",
+ netype="XGW",
+ vendor="ZTE",
+ vnfSoftwareVersion="V1",
+ version="V1",
+ package_id="2",
+ status='NOT_INSTANTIATED').save()
def tearDown(self):
- pass
+ NfInstModel.objects.filter(nfinstid='98765').delete()
def test_scale_vnf_to_level_not_found(self):
url = "/api/vnflcm/v1/vnf_instances/12/scale_to_level"
@@ -33,3 +45,10 @@ class TestNfScaleToLevel(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/98765/scale_to_level"
+ response = self.client.post(url,
+ data=self.req_data,
+ format='json')
+ self.failUnlessEqual(status.HTTP_409_CONFLICT, response.status_code)