X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2F2.2.1%2Ftest02_topo_portmapping.py;h=586b882f1868933b174bae4144b0974485f0f862;hb=b2d07165c8569f76c1abc0af4c3a0544ddb16a9d;hp=6051f7e53cdea54d7a31285d3664659229cb6178;hpb=37dd5aeef844a7f37cfd70589670c5bacbbe1645;p=transportpce.git diff --git a/tests/transportpce_tests/2.2.1/test02_topo_portmapping.py b/tests/transportpce_tests/2.2.1/test02_topo_portmapping.py index 6051f7e53..586b882f1 100644 --- a/tests/transportpce_tests/2.2.1/test02_topo_portmapping.py +++ b/tests/transportpce_tests/2.2.1/test02_topo_portmapping.py @@ -50,13 +50,13 @@ class TransportPCEtesting(unittest.TestCase): # Verify the termination points of the ROADMA def test_02_compareOpenroadmTopologyPortMapping_rdm(self): - responseTopo = test_utils_rfc8040.get_request(test_utils_rfc8040.URL_CONFIG_ORDM_TOPO) - resTopo = responseTopo.json() - firstEntry = resTopo['ietf-network:network'][0]['node'] + resTopo = test_utils_rfc8040.get_ietf_network_request('openroadm-topology', 'config') + self.assertEqual(resTopo['status_code'], requests.codes.ok) nbMapCumul = 0 nbMappings = 0 - for i in range(0, len(firstEntry)): - nodeId = firstEntry[i]['node-id'] + for node in resTopo['network'][0]['node']: + nodeId = node['node-id'] + # pylint: disable=consider-using-f-string print("nodeId={}".format(nodeId)) nodeMapId = nodeId.split("-")[0] + "-" + nodeId.split("-")[1] print("nodeMapId={}".format(nodeMapId)) @@ -64,10 +64,9 @@ class TransportPCEtesting(unittest.TestCase): self.assertEqual(response['status_code'], requests.codes.ok) responseMapList = test_utils_rfc8040.get_portmapping(nodeMapId) nbMappings = len(responseMapList['nodes'][0]['mapping']) - nbMapCumul - nbTp = len(firstEntry[i]['ietf-network-topology:termination-point']) nbMapCurrent = 0 - for j in range(0, nbTp): - tpId = firstEntry[i]['ietf-network-topology:termination-point'][j]['tp-id'] + for tp in node['ietf-network-topology:termination-point']: + tpId = tp['tp-id'] if (not "CP" in tpId) and (not "CTP" in tpId): responseMap = test_utils_rfc8040.portmapping_request(nodeMapId, tpId) self.assertEqual(responseMap['status_code'], requests.codes.ok)