# pylint: disable=no-member
# pylint: disable=too-many-public-methods
+# pylint: disable=too-many-lines
import base64
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1':
+ if node['node-id'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1':
+ if node['node-id'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if (node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1'):
+ if node['node-id'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1':
+ if node['node-id'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
time.sleep(2)
def test_66_create_OCH_OTU4_service_2(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service2-OCH-OTU4"
self.cr_serv_sample_data["input"]["connection-type"] = "infrastructure"
self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "100"
time.sleep(2)
def test_68_create_ODU4_service_2(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service2-ODU4"
self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "ODU"
self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
time.sleep(2)
def test_70_create_1GE_service(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service1-1GE"
self.cr_serv_sample_data["input"]["connection-type"] = "service"
self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "1"
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'SPDR-SA1-XPDR3' or 'SPDR-SC1-XPDR3':
+ if node['node-id'] in ('SPDR-SA1-XPDR3', 'SPDR-SC1-XPDR3'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR3-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if (node['node-id'] == 'SPDR-SA1-XPDR3' or 'SPDR-SC1-XPDR3'):
+ if node['node-id'] in ('SPDR-SA1-XPDR3', 'SPDR-SC1-XPDR3'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR3-NETWORK1':
res = response.json()
links = res['network'][0]['ietf-network-topology:link']
for link in links:
- if (link["org-openroadm-common-network:link-type"] == "XPONDER-OUTPUT" or
- link["org-openroadm-common-network:link-type"] == "XPONDER-INPUT"):
+ if link["org-openroadm-common-network:link-type"] in ('XPONDER-OUTPUT', 'XPONDER-INPUT'):
link_name = link["link-id"]
response = test_utils.delete_request(url+link_name)
self.assertEqual(response.status_code, requests.codes.ok)