summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2019-04-09 11:10:35 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2019-04-09 11:10:35 +0800
commitd12c538730fdbf4d27f96228b3fc8129b026b399 (patch)
tree1e22da46d74e06180fbdccf6b3d863d8b107c02a
parentd26d9cf8f0230f7d612fdbc970a65b177bb7ac65 (diff)
Add test case for change flavour
Change-Id: I18b8e1a624d574149892a9977195db35b7041b4b Issue-ID: VFC-1306 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/lcm/nf/tests/test_change_flavour.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/lcm/lcm/nf/tests/test_change_flavour.py b/lcm/lcm/nf/tests/test_change_flavour.py
index d8da3ae7..75d06336 100644
--- a/lcm/lcm/nf/tests/test_change_flavour.py
+++ b/lcm/lcm/nf/tests/test_change_flavour.py
@@ -15,16 +15,28 @@ from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
+from lcm.pub.database.models import NfInstModel
+
class TestFlavour(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 = {
"newFlavourId": "myFlavour_new"
}
def tearDown(self):
- pass
+ NfInstModel.objects.filter(nfinstid='12345').delete()
def test_change_flavour_not_found(self):
url = "/api/vnflcm/v1/vnf_instances/12/change_flavour"
@@ -32,3 +44,10 @@ class TestFlavour(TestCase):
data=self.req_data,
format='json')
self.failUnlessEqual(status.HTTP_404_NOT_FOUND, response.status_code)
+
+ def test_change_flavour_conflict(self):
+ url = "/api/vnflcm/v1/vnf_instances/12345/change_flavour"
+ response = self.client.post(url,
+ data=self.req_data,
+ format='json')
+ self.failUnlessEqual(status.HTTP_409_CONFLICT, response.status_code)