fix superflous parenthesis pointed out by pylint
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test_topoPortMapping.py
index fda216c2fa783974cc81f9b98aa5ef3546210639..d74b42d1982ba5319c8dbf50ede8a9bb4eb9caef 100644 (file)
@@ -9,8 +9,10 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
-import json
 import time
 import requests
 from common import test_utils
@@ -51,8 +53,7 @@ class TransportPCEtesting(unittest.TestCase):
             print("nodeId={}".format(nodeId))
             nodeMapId = nodeId.split("-")[0] + "-" + nodeId.split("-")[1]
             print("nodeMapId={}".format(nodeMapId))
-            urlMapList = "{}/config/transportpce-portmapping:network/nodes/" + nodeMapId
-            responseMapList = test_utils.get_request(urlMapList)
+            responseMapList = test_utils.portmapping_request(nodeMapId)
             resMapList = responseMapList.json()
 
             nbMappings = len(resMapList['nodes'][0]['mapping']) - nbMapCumul
@@ -60,11 +61,10 @@ class TransportPCEtesting(unittest.TestCase):
             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)):
-                    urlMap = "{}/config/transportpce-portmapping:network/nodes/" + nodeMapId + "/mapping/" + tpId
-                    responseMap = test_utils.get_request(urlMap)
+                if (not "CP" in tpId) and (not "CTP" in tpId):
+                    responseMap = test_utils.portmapping_request(nodeMapId+"/mapping/"+tpId)
                     self.assertEqual(responseMap.status_code, requests.codes.ok)
-                    if(responseMap.status_code == requests.codes.ok):
+                    if responseMap.status_code == requests.codes.ok:
                         nbMapCurrent += 1
             nbMapCumul += nbMapCurrent
         nbMappings -= nbMapCurrent