diff options
-rw-r--r-- | mgr/mgr/vnfreg/tests.py | 18 | ||||
-rw-r--r-- | mgr/tox.ini | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/mgr/mgr/vnfreg/tests.py b/mgr/mgr/vnfreg/tests.py index b3ffccc..6d95081 100644 --- a/mgr/mgr/vnfreg/tests.py +++ b/mgr/mgr/vnfreg/tests.py @@ -118,13 +118,13 @@ class VnfRegTest(unittest.TestCase): "password": vnfs[0].password } self.assertEqual(self.vnfInst1, vnfInstActual) - + def test_add_vnf_when_duplicate(self): self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json') response = self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json') self.assertEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code, response.content) self.assertEqual({'error': "Vnf(1) already exists."}, json.loads(response.content)) - + def test_set_vnf_normal(self): self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json') response = self.client.put("/api/vnfmgr/v1/vnfs/1", @@ -140,41 +140,41 @@ class VnfRegTest(unittest.TestCase): "password": vnfs[0].password } self.assertEqual(self.vnfInst1_new, vnfInstActual) - + def test_set_vnf_when_not_exist(self): response = self.client.put("/api/vnfmgr/v1/vnfs/1", json.dumps(self.vnfInst1_new), content_type='application/json') self.assertEqual(status.HTTP_404_NOT_FOUND, response.status_code, response.content) self.assertEqual({'error': "Vnf(1) does not exist."}, json.loads(response.content)) - + def test_get_vnf_normal(self): self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json') response = self.client.get("/api/vnfmgr/v1/vnfs/1") self.assertEqual(status.HTTP_200_OK, response.status_code, response.content) self.assertEqual(self.vnfInst1, json.loads(response.content)) - + def test_get_vnf_when_not_exist(self): response = self.client.get("/api/vnfmgr/v1/vnfs/1") self.assertEqual(status.HTTP_404_NOT_FOUND, response.status_code, response.content) self.assertEqual({'error': "Vnf(1) does not exist."}, json.loads(response.content)) - + def test_del_vnf_normal(self): self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json') response = self.client.delete("/api/vnfmgr/v1/vnfs/1") self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code, response.content) - + def test_del_vnf_when_not_exist(self): response = self.client.delete("/api/vnfmgr/v1/vnfs/1") self.assertEqual(status.HTTP_404_NOT_FOUND, response.status_code, response.content) self.assertEqual({'error': "Vnf(1) does not exist."}, json.loads(response.content)) - + @mock.patch.object(restcall, 'call_req') def test_vnf_config_normal(self, mock_call_req): mock_call_req.return_value = [0, "", '204'] self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json') response = self.client.post("/api/vnfmgr/v1/configuration", self.vnfconfig, format='json') self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.content) - + def test_vnf_config_when_not_exist(self): response = self.client.post("/api/vnfmgr/v1/configuration", self.vnfconfig, format='json') self.assertEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code, response.content) diff --git a/mgr/tox.ini b/mgr/tox.ini index 86ffd21..7cd3add 100644 --- a/mgr/tox.ini +++ b/mgr/tox.ini @@ -6,7 +6,7 @@ skipsdist = true downloadcache = ~/cache/pip [flake8] -ignore = E501,W293,E128 +ignore = E501,E128 [testenv] deps = -r{toxinidir}/requirements.txt |