summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2017-09-26 09:06:02 +0800
committerFu Jinhua <fu.jinhua@zte.com.cn>2017-09-26 01:35:56 +0000
commit6b18966c65a8e4f8ff5495de7ffc5579a1ceeb38 (patch)
treed74881ed34c8d25abdbed511278b71e1b45bc937
parent9703f9bc0a008f4c4a51fc18553f2d03276b96b8 (diff)
Fix pep8 error for sfcs_test.
Change-Id: I029f8d2960d3aa8c052503a89a37e134c662dc8b Issue-Id: VFC-451 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/ns/tests/sfcs/test_data.py4
-rw-r--r--lcm/ns/tests/sfcs/test_sfcdetailview.py31
2 files changed, 12 insertions, 23 deletions
diff --git a/lcm/ns/tests/sfcs/test_data.py b/lcm/ns/tests/sfcs/test_data.py
index e8734648..8d58c692 100644
--- a/lcm/ns/tests/sfcs/test_data.py
+++ b/lcm/ns/tests/sfcs/test_data.py
@@ -1405,7 +1405,3 @@ vnfd_model_dict2 = {
],
}
}
-
-
-
-
diff --git a/lcm/ns/tests/sfcs/test_sfcdetailview.py b/lcm/ns/tests/sfcs/test_sfcdetailview.py
index 851f6c81..9e18af10 100644
--- a/lcm/ns/tests/sfcs/test_sfcdetailview.py
+++ b/lcm/ns/tests/sfcs/test_sfcdetailview.py
@@ -18,9 +18,10 @@ import mock
from django.test import TestCase, Client
from rest_framework import status
from lcm.pub.msapi import sdncdriver
-from lcm.pub.database.models import FPInstModel, VNFFGInstModel, NfInstModel
-from lcm.pub.utils import restcall
+from lcm.pub.database.models import FPInstModel
from lcm.pub.msapi import resmgr
+
+
class TestSfcDetailViews(TestCase):
def setUp(self):
self.client = Client()
@@ -28,16 +29,9 @@ class TestSfcDetailViews(TestCase):
self.sfc_inst_id = str(uuid.uuid4())
self.status = "active"
self.sdn_controler_id = str(uuid.uuid4())
- sfc_id = str(uuid.uuid4())
- flow_classifiers = "flow1,flow2"
- port_pair_groups = json.JSONEncoder().encode(
- [{"groupid": "group1", "portpair": [str(uuid.uuid4()), str(uuid.uuid4())]},
- {"groupid": "group2", "portpair": [str(uuid.uuid4()), str(uuid.uuid4())]}])
-
def tearDown(self):
- pass
-
+ pass
def test_sfc_delete_failed(self):
response = self.client.delete("/api/nslcm/v1/ns/sfcs/%s" % "notExist")
@@ -52,11 +46,11 @@ class TestSfcDetailViews(TestCase):
@mock.patch.object(sdncdriver, "delete_port_pair")
@mock.patch.object(resmgr, "delete_sfc")
def test_sfc_delete_success(self, mock_delete_sfc, mock_delete_port_pair, mock_delete_port_pair_group, mock_delete_flow_classifier, mock_delete_port_chain, mock_get_sdn_controller_by_id):
- mock_delete_port_chain.return_value=None
- mock_delete_flow_classifier.return_value=None
- mock_delete_port_pair_group.return_value=None
- mock_delete_port_pair.return_value=None
- mock_delete_sfc.return_value=None
+ mock_delete_port_chain.return_value = None
+ mock_delete_flow_classifier.return_value = None
+ mock_delete_port_pair_group.return_value = None
+ mock_delete_port_pair.return_value = None
+ mock_delete_sfc.return_value = None
mock_get_sdn_controller_by_id.return_value = json.loads('{"test":"test_name","url":"url_add"}')
sfc_inst_id = "10"
@@ -70,17 +64,16 @@ class TestSfcDetailViews(TestCase):
self.assertEqual(expect_resp_data, response.data)
def test_sfc_get_failed(self):
- sfc_inst_id="10"
+ sfc_inst_id = "10"
response = self.client.get("/api/nslcm/v1/ns/sfcs/%s" % sfc_inst_id)
self.assertEqual(status.HTTP_404_NOT_FOUND, response.status_code)
def test_sfc_get_success(self):
- sfc_inst_id ="10"
+ sfc_inst_id = "10"
FPInstModel(fpid="1", fpinstid="10", fpname="2", nsinstid="3", vnffginstid="4",
symmetric="5", policyinfo="6", forworderpaths="7", status="8", sdncontrollerid="9",
sfcid="10", flowclassifiers="11",
portpairgroups="12").save()
response = self.client.get("/api/nslcm/v1/ns/sfcs/%s" % sfc_inst_id)
- expect_resp_data={'sfcName': 'xxx', 'sfcInstId': '10', 'sfcStatus': '8'}
+ expect_resp_data = {'sfcName': 'xxx', 'sfcInstId': '10', 'sfcStatus': '8'}
self.assertEqual(expect_resp_data, response.data)
-