diff options
author | Fu Jinhua <fu.jinhua@zte.com.cn> | 2018-08-20 00:48:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-08-20 00:48:54 +0000 |
commit | 46120beda901ed8347dc2717b2d279fe647a9e08 (patch) | |
tree | d2d9b7502c8e546eb95c3b745310b02305881acf | |
parent | 63bf2f198aebac4e62a162892a2916ffd33d5065 (diff) | |
parent | d2dc48b3cec803261a2673cac09a7fffefd43e7e (diff) |
Merge "Dealing with test related stuffs."
-rw-r--r-- | lcm/lcm/nf/tests/test_query_vnf.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lcm/lcm/nf/tests/test_query_vnf.py b/lcm/lcm/nf/tests/test_query_vnf.py index ccb40c05..40151850 100644 --- a/lcm/lcm/nf/tests/test_query_vnf.py +++ b/lcm/lcm/nf/tests/test_query_vnf.py @@ -122,6 +122,11 @@ class ResourceTest(TestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(self.test_data_single_vnf, response.data) + def test_get_vnf_not_exist(self): + response = self.client.get("/api/vnflcm/v1/vnf_instances/x", format='json') + self.assertEqual(response.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR) + self.assertEqual({'error': 'VnfInst(x) does not exist'}, response.data) + def test_get_vnfs(self): for i in range(1, 3): NfInstModel(nfinstid='%s' % i, @@ -135,3 +140,8 @@ class ResourceTest(TestCase): response = self.client.get("/api/vnflcm/v1/vnf_instances", format='json') self.failUnlessEqual(status.HTTP_200_OK, response.status_code) self.assertEqual(self.test_data_multi_vnf, response.data) + + def test_get_vnfs_not_exist(self): + response = self.client.get("/api/vnflcm/v1/vnf_instances", format='json') + self.assertEqual(response.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR) + self.assertEqual({'error': 'VnfInsts does not exist'}, response.data) |