summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-09-23 14:07:58 +0800
committerFu Jinhua <fu.jinhua@zte.com.cn>2017-09-23 07:12:01 +0000
commiteafb3ea2dc0ace4f5dc007994330ad12e939b13a (patch)
treefb12096b6c9fd9deebda72cde154074c0f5d414a
parent1686e5f5efd3bcb82aebd30993dd8b11336930a8 (diff)
Fix vfc-gvnfm-vnfmgr pep8 W293 issue.
Change-Id: Iebecf5e66032096700442fbe43fbf5f8e31982a9 Issue-ID: VFC-443 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--mgr/mgr/vnfreg/tests.py18
-rw-r--r--mgr/tox.ini2
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