summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2019-04-23 09:35:18 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2019-04-23 09:35:18 +0800
commit65b27452d96a4c49395238588615c133b3ffd1e8 (patch)
tree43f20920fb655ef9848e6bf29baeddff33c34b7e
parentb5d356713db3b4e3c662ea07dd96dc0b44b94548 (diff)
Add chg flavour ut case
Change-Id: Idcade372105ae450f42c7d5bc3bf54237f4d3a7b Issue-ID: VFC-1306 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/lcm/nf/tests/test_change_flavour.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/lcm/lcm/nf/tests/test_change_flavour.py b/lcm/lcm/nf/tests/test_change_flavour.py
index 75d06336..7c15dfbd 100644
--- a/lcm/lcm/nf/tests/test_change_flavour.py
+++ b/lcm/lcm/nf/tests/test_change_flavour.py
@@ -31,12 +31,23 @@ class TestFlavour(TestCase):
version="V1",
package_id="2",
status='NOT_INSTANTIATED').save()
+ NfInstModel(nfinstid='345',
+ 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 = {
"newFlavourId": "myFlavour_new"
}
def tearDown(self):
NfInstModel.objects.filter(nfinstid='12345').delete()
+ NfInstModel.objects.filter(nfinstid='345').delete()
def test_change_flavour_not_found(self):
url = "/api/vnflcm/v1/vnf_instances/12/change_flavour"
@@ -51,3 +62,10 @@ class TestFlavour(TestCase):
data=self.req_data,
format='json')
self.failUnlessEqual(status.HTTP_409_CONFLICT, response.status_code)
+
+ def test_change_flavour_inner_error(self):
+ url = "/api/vnflcm/v1/vnf_instances/345/change_flavour"
+ response = self.client.post(url,
+ data={},
+ format='json')
+ self.failUnlessEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code)