fix some pylint issues
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test_topoPortMapping.py
index f1a460103811268d2b8a0c48bbfb7aecbc2ccdd7..683b04a48649fa5e491d09d3b21f8c05b8a20f41 100644 (file)
@@ -11,6 +11,8 @@
 
 # pylint: disable=no-member
 # pylint: disable=too-many-public-methods
+# a pylint false positive due to unittest
+# pylint: disable=no-self-use
 
 import time
 import unittest
@@ -29,6 +31,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     @classmethod
     def tearDownClass(cls):
+        # pylint: disable=not-an-iterable
         for process in cls.processes:
             test_utils.shutdown_process(process)
         print("all processes killed")
@@ -42,24 +45,19 @@ class TransportPCEtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     # Verify the termination points of the ROADMA
-    def test_02_compareOpenroadmTopologyPortMapping_rdm(self):
+    def test_02_compare_Openroadm_topology_portmapping_rdm(self):
         responseTopo = test_utils.get_ordm_topo_request("")
         resTopo = responseTopo.json()
         nbNode = len(resTopo['network'][0]['node'])
-        nbMapCumul = 0
-        nbMappings = 0
         for i in range(0, nbNode):
             nodeId = resTopo['network'][0]['node'][i]['node-id']
             nodeMapId = nodeId.split("-")[0]
-            responseMapList = test_utils.portmapping_request(nodeMapId)
-            resMapList = responseMapList.json()
-            nbMappings = len(resMapList['nodes'][0]['mapping']) - nbMapCumul
+            test_utils.portmapping_request(nodeMapId)
             nbTp = len(resTopo['network'][0]['node'][i]['ietf-network-topology:termination-point'])
-            nbMapCurrent = 0
             for j in range(0, nbTp):
                 tpId = resTopo['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
                 if((not "CP" in tpId) and (not "CTP" in tpId)):
-                    responseMap = test_utils.portmapping_request(nodeMapId+"/mapping/"+tpId)
+                    test_utils.portmapping_request(nodeMapId+"/mapping/"+tpId)
 
     # Disconnect the ROADMA
     def test_03_disconnect_rdm(self):
@@ -72,8 +70,8 @@ class TransportPCEtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
 #     #Verify the termination points related to XPDR
-    def test_05_compareOpenroadmTopologyPortMapping_xpdr(self):
-        self.test_02_compareOpenroadmTopologyPortMapping_rdm()
+    def test_05_compare_Openroadm_topology_portmapping_xpdr(self):
+        self.test_02_compare_Openroadm_topology_portmapping_rdm()
 
     # Disconnect the XPDRA
     def test_06_disconnect_device(self):