Fix more pylint warnings 03/98703/4
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 26 Nov 2021 10:45:04 +0000 (11:45 +0100)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Tue, 30 Nov 2021 10:11:45 +0000 (10:11 +0000)
JIRA: TRNSPRTPCE-320
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Ia99c607c48ad4a6bb305bf800e8f54d1f741e4df

22 files changed:
tests/transportpce_tests/1.2.1/test01_portmapping.py
tests/transportpce_tests/1.2.1/test04_renderer_service_path_nominal.py
tests/transportpce_tests/1.2.1/test05_olm.py
tests/transportpce_tests/1.2.1/test06_end2end.py
tests/transportpce_tests/2.2.1/test01_portmapping.py
tests/transportpce_tests/2.2.1/test02_topo_portmapping.py
tests/transportpce_tests/2.2.1/test04_otn_topology.py
tests/transportpce_tests/2.2.1/test05_flex_grid.py
tests/transportpce_tests/2.2.1/test09_olm.py
tests/transportpce_tests/2.2.1/test10_tapi.py
tests/transportpce_tests/2.2.1/test12_end2end.py
tests/transportpce_tests/2.2.1/test13_tapi_full_multi_layer.py
tests/transportpce_tests/2.2.1/test14_otn_switch_end2end.py
tests/transportpce_tests/7.1/test01_portmapping.py
tests/transportpce_tests/common/test_utils.py
tests/transportpce_tests/common/test_utils_rfc8040.py
tests/transportpce_tests/hybrid/test01_device_change_notifications.py
tests/transportpce_tests/hybrid/test02_B100G_end2end.py
tests/transportpce_tests/pce/test01_pce.py
tests/transportpce_tests/pce/test02_pce_400G.py
tests/transportpce_tests/with_docker/test01_gnpy.py
tests/transportpce_tests/with_docker/test02_nbinotifications.py

index e94852fdb5138b9b63a8625eb1b8e03189db8c91..9d28b0c4ded65f91c722deb28cc70e3b4ee21a0d 100644 (file)
@@ -41,6 +41,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(10)
 
index c6390cffbf2172875fe214595290244bdf7d5fd3..485ce41695be5e1410b91994228bed8db12d34f7 100644 (file)
@@ -41,6 +41,7 @@ class TransportPCERendererTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(10)
 
index 19473bd8bcacc9d663656676e9f1cf63069561ba..050609975f3d51e44e2691a54ca4aaf34a348ec1 100644 (file)
@@ -44,6 +44,7 @@ class TransportOlmTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(1)
 
index f33eeccc6164cc33e8fd3588ca724288d77e9288..c8f4eac61a76ce552fb7e2d1fd6259e0cfea38c5 100644 (file)
@@ -141,6 +141,7 @@ class TransportPCEFulltesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):  # instruction executed before each test method
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
 
     #  connect netconf devices
@@ -816,6 +817,7 @@ class TransportPCEFulltesting(unittest.TestCase):
         self.test_35_check_topo_ROADMA_DEG1()
 
     def test_49_loop_create_eth_service(self):
+        # pylint: disable=consider-using-f-string
         for i in range(1, 6):
             print("iteration number {}".format(i))
             print("eth service creation")
@@ -833,6 +835,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             response = test_utils.service_delete_request("service1")
             time.sleep(5)
 
+        # pylint: disable=consider-using-f-string
         for i in range(1, 6):
             print("iteration number {}".format(i))
             print("oc service creation")
index f5f38e0b453e5eb80a7da901526b9c926c6458fd..fa650b74259640117b8370db19c8a04c799e9355 100644 (file)
@@ -41,6 +41,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(10)
 
index 6051f7e53cdea54d7a31285d3664659229cb6178..06e83473b9efbfd6adb04b182477a3768747454f 100644 (file)
@@ -57,6 +57,7 @@ class TransportPCEtesting(unittest.TestCase):
         nbMappings = 0
         for i in range(0, len(firstEntry)):
             nodeId = firstEntry[i]['node-id']
+            # pylint: disable=consider-using-f-string
             print("nodeId={}".format(nodeId))
             nodeMapId = nodeId.split("-")[0] + "-" + nodeId.split("-")[1]
             print("nodeMapId={}".format(nodeMapId))
index 5e9b3b85802177a2312be8aa485c03ff7a5eefc1..41b1f65b045ee05e4a54b79ab4afd9e7e87b6358 100644 (file)
@@ -185,6 +185,7 @@ class TransportPCEtesting(unittest.TestCase):
                     tpId = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
                     if tpType == 'XPONDER-CLIENT':
                         client += 1
+                        # pylint: disable=consider-using-f-string
                         print("tpId = {}".format(tpId))
                         print("tp= {}".format(res['network'][0]['node'][i]
                               ['ietf-network-topology:termination-point'][j]))
index 7c3dbff45d09c1ed8c5c5e73c69222350f8bdf4d..1fc4a37240c277519039dfba7699920d86fa5d19 100644 (file)
@@ -37,6 +37,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(10)
 
index 37c41670a63f5adc60602c95d3b770522f36c186..63ced0f742a591c969d35798ae5ebf0662e873c5 100644 (file)
@@ -44,6 +44,7 @@ class TransportOlmTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(1)
 
index cbc6e857a967216ac011cc10a7f8525c301aa66f..2faec1bd12b72e816015df463b764c27dee886a1 100644 (file)
@@ -176,6 +176,7 @@ class TransportTapitesting(unittest.TestCase):
     def setUp(self):  # instruction executed before each test method
         if self.init_failed:
             self.fail('Feature installation failed')
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
 
     def test_01_get_tapi_topology_T100G(self):
index 333244a7f039ee7b20ad653ee02a67fb2c0a2483..9472e3892057e9b3e9591257975cb98ce5cc666e 100644 (file)
@@ -134,6 +134,7 @@ class TransportPCEFulltesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):  # instruction executed before each test method
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
 
     def test_01_connect_xpdrA(self):
@@ -766,6 +767,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_49_loop_create_eth_service(self):
         for i in range(1, 6):
+            # pylint: disable=consider-using-f-string
             print("iteration number {}".format(i))
             print("eth service creation")
             self.test_11_create_eth_service1()
@@ -783,6 +785,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             time.sleep(5)
 
         for i in range(1, 6):
+            # pylint: disable=consider-using-f-string
             print("iteration number {}".format(i))
             print("oc service creation")
             self.test_36_create_oc_service1()
index 37318b08a019c994ec56d51530bbde2b8c140dca..8987dedb2f2cdd3c3e74a4efcfd484cd0c588f81 100644 (file)
@@ -255,8 +255,9 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(self.WAITING)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        global service_pm_uuid
-        service_pm_uuid = res['output']['service']['uuid']
+        global SERVICE_PM_UUID
+        SERVICE_PM_UUID = res['output']['service']['uuid']
+        # pylint: disable=consider-using-f-string
         print("photonic media service uuid : {}".format(res['output']['service']['uuid']))
 
         input_dict_1 = {'administrative-state': 'LOCKED',
@@ -281,13 +282,13 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_16_get_service_PhotonicMedia(self):
         response = test_utils.get_service_list_request(
-            "services/" + str(service_pm_uuid))
+            "services/" + str(SERVICE_PM_UUID))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(
             res['services'][0]['administrative-state'], 'inService')
         self.assertEqual(
-            res['services'][0]['service-name'], service_pm_uuid)
+            res['services'][0]['service-name'], SERVICE_PM_UUID)
         self.assertEqual(
             res['services'][0]['connection-type'], 'infrastructure')
         self.assertEqual(
@@ -307,8 +308,9 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(self.WAITING)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        global service_odu_uuid
-        service_odu_uuid = res['output']['service']['uuid']
+        global SERVICE_ODU_UUID
+        SERVICE_ODU_UUID = res['output']['service']['uuid']
+        # pylint: disable=consider-using-f-string
         print("odu service uuid : {}".format(res['output']['service']['uuid']))
 
         input_dict_1 = {'administrative-state': 'LOCKED',
@@ -333,13 +335,13 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_18_get_service_ODU(self):
         response = test_utils.get_service_list_request(
-            "services/" + str(service_odu_uuid))
+            "services/" + str(SERVICE_ODU_UUID))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(
             res['services'][0]['administrative-state'], 'inService')
         self.assertEqual(
-            res['services'][0]['service-name'], service_odu_uuid)
+            res['services'][0]['service-name'], SERVICE_ODU_UUID)
         self.assertEqual(
             res['services'][0]['connection-type'], 'infrastructure')
         self.assertEqual(
@@ -360,8 +362,9 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(self.WAITING)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        global service_dsr_uuid
-        service_dsr_uuid = res['output']['service']['uuid']
+        global SERVICE_DSR_UUID
+        SERVICE_DSR_UUID = res['output']['service']['uuid']
+        # pylint: disable=consider-using-f-string
         print("dsr service uuid : {}".format(res['output']['service']['uuid']))
 
         input_dict_1 = {'administrative-state': 'LOCKED',
@@ -389,13 +392,13 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_20_get_service_DSR(self):
         response = test_utils.get_service_list_request(
-            "services/" + str(service_dsr_uuid))
+            "services/" + str(SERVICE_DSR_UUID))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(
             res['services'][0]['administrative-state'], 'inService')
         self.assertEqual(
-            res['services'][0]['service-name'], service_dsr_uuid)
+            res['services'][0]['service-name'], SERVICE_DSR_UUID)
         self.assertEqual(
             res['services'][0]['connection-type'], 'service')
         self.assertEqual(
@@ -408,17 +411,17 @@ class TransportPCEtesting(unittest.TestCase):
         res = response.json()
         liste_service = res['output']['service']
         for ele in liste_service:
-            if ele['uuid'] == service_pm_uuid:
+            if ele['uuid'] == SERVICE_PM_UUID:
                 self.assertEqual(ele['operational-state'], 'ENABLED')
                 self.assertEqual(ele['service-layer'], 'PHOTONIC_MEDIA')
                 nbconnection = len(ele['connection'])
                 self.assertEqual(nbconnection, 9, 'There should be 9 connections')
-            elif ele['uuid'] == service_odu_uuid:
+            elif ele['uuid'] == SERVICE_ODU_UUID:
                 self.assertEqual(ele['operational-state'], 'ENABLED')
                 self.assertEqual(ele['service-layer'], 'ODU')
                 nbconnection = len(ele['connection'])
                 self.assertEqual(nbconnection, 3, 'There should be 3 connections')
-            elif ele['uuid'] == service_dsr_uuid:
+            elif ele['uuid'] == SERVICE_DSR_UUID:
                 self.assertEqual(ele['operational-state'], 'ENABLED')
                 self.assertEqual(ele['service-layer'], 'DSR')
                 nbconnection = len(ele['connection'])
@@ -428,17 +431,17 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(2)
 
     def test_22_delete_connectivity_service_DSR(self):
-        response = test_utils.tapi_delete_connectivity_request(service_dsr_uuid)
+        response = test_utils.tapi_delete_connectivity_request(SERVICE_DSR_UUID)
         self.assertEqual(response.status_code, requests.codes.no_content)
         time.sleep(self.WAITING)
 
     def test_23_delete_connectivity_service_ODU(self):
-        response = test_utils.tapi_delete_connectivity_request(service_odu_uuid)
+        response = test_utils.tapi_delete_connectivity_request(SERVICE_ODU_UUID)
         self.assertEqual(response.status_code, requests.codes.no_content)
         time.sleep(self.WAITING)
 
     def test_24_delete_connectivity_service_PhotonicMedia(self):
-        response = test_utils.tapi_delete_connectivity_request(service_pm_uuid)
+        response = test_utils.tapi_delete_connectivity_request(SERVICE_PM_UUID)
         self.assertEqual(response.status_code, requests.codes.no_content)
         time.sleep(self.WAITING)
 
index 4f87063eba7aa4e14e6576f74f47e57dbaadcaf3..ab5a56225a5a395930cabdc546bc1d52c5dcb95a 100644 (file)
@@ -737,6 +737,7 @@ class TransportPCEtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         liste_tp = res['node'][0]['ietf-network-topology:termination-point']
+        # pylint: disable=consider-using-f-string
         for ele in liste_tp:
             if ele['tp-id'] == 'XPDR2-NETWORK1':
                 self.assertEqual({'frequency': 196.1,
index 38971fd268eafb54e86403156a13ac375ed56308..b5317f550fcdd73d4c968a2dc0e8b4959c2abe2c 100644 (file)
@@ -40,6 +40,7 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(10)
 
index 95388ac6ffbc4f016543e5f94acb94d198bb43f8..c18a4d1f5ee1288834881c70e5f9835ae3864ef9 100644 (file)
@@ -133,7 +133,7 @@ def start_karaf():
     executable = os.path.join(
         os.path.dirname(os.path.realpath(__file__)),
         "..", "..", "..", KARAF_INSTALLDIR, "target", "assembly", "bin", "karaf")
-    with open('odl.log', 'w') as outfile:
+    with open('odl.log', 'w', encoding='utf-8') as outfile:
         return subprocess.Popen(
             ["sh", executable, "server"], stdout=outfile, stderr=outfile, stdin=None)
 
@@ -144,7 +144,7 @@ def start_lighty():
         os.path.dirname(os.path.realpath(__file__)),
         "..", "..", "..", "lighty", "target", "tpce",
         "clean-start-controller.sh")
-    with open(TPCE_LOG, 'w') as outfile:
+    with open(TPCE_LOG, 'w', encoding='utf-8') as outfile:
         return subprocess.Popen(
             ["sh", executable], stdout=outfile, stderr=outfile, stdin=None)
 
@@ -498,7 +498,7 @@ def start_honeynode(log_file: str, sim):
     sample_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                     "..", "..", "sample_configs", "openroadm", sim[1])
     if os.path.isfile(executable):
-        with open(log_file, 'w') as outfile:
+        with open(log_file, 'w', encoding='utf-8') as outfile:
             return subprocess.Popen(
                 [executable, SIMS[sim]['port'], os.path.join(sample_directory, SIMS[sim]['configfile'])],
                 stdout=outfile, stderr=outfile)
@@ -514,7 +514,7 @@ def wait_until_log_contains(log_file, regexp, time_to_wait=60):
         with TimeOut(seconds=time_to_wait):
             while not os.path.exists(log_file):
                 time.sleep(0.2)
-            filelogs = open(log_file, 'r')
+            filelogs = open(log_file, 'r', encoding='utf-8')
             filelogs.seek(0, 2)
             filefound = True
             print("Searching for pattern '" + regexp + "' in " + os.path.basename(log_file), end='... ', flush=True)
index 61506ed83771d4eae788d5941a69f46c35669575..e1323f2172f539e4816c409ad2dc15212d81c0c3 100644 (file)
@@ -143,7 +143,7 @@ def start_karaf():
     executable = os.path.join(
         os.path.dirname(os.path.realpath(__file__)),
         "..", "..", "..", KARAF_INSTALLDIR, "target", "assembly", "bin", "karaf")
-    with open('odl.log', 'w') as outfile:
+    with open('odl.log', 'w', encoding='utf-8') as outfile:
         return subprocess.Popen(
             ["sh", executable, "server"], stdout=outfile, stderr=outfile, stdin=None)
 
@@ -154,7 +154,7 @@ def start_lighty():
         os.path.dirname(os.path.realpath(__file__)),
         "..", "..", "..", "lighty", "target", "tpce",
         "clean-start-controller.sh")
-    with open(TPCE_LOG, 'w') as outfile:
+    with open(TPCE_LOG, 'w', encoding='utf-8') as outfile:
         return subprocess.Popen(
             ["sh", executable], stdout=outfile, stderr=outfile, stdin=None)
 
@@ -184,7 +184,7 @@ def start_honeynode(log_file: str, sim):
     sample_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                     "..", "..", "sample_configs", "openroadm", sim[1])
     if os.path.isfile(executable):
-        with open(log_file, 'w') as outfile:
+        with open(log_file, 'w', encoding='utf-8') as outfile:
             return subprocess.Popen(
                 [executable, SIMS[sim]['port'], os.path.join(sample_directory, SIMS[sim]['configfile'])],
                 stdout=outfile, stderr=outfile)
@@ -200,7 +200,7 @@ def wait_until_log_contains(log_file, regexp, time_to_wait=60):
         with TimeOut(seconds=time_to_wait):
             while not os.path.exists(log_file):
                 time.sleep(0.2)
-            filelogs = open(log_file, 'r')
+            filelogs = open(log_file, 'r', encoding='utf-8')
             filelogs.seek(0, 2)
             filefound = True
             print("Searching for pattern '" + regexp + "' in " + os.path.basename(log_file), end='... ', flush=True)
@@ -308,7 +308,7 @@ def get_portmapping_node_info(node: str):
     url = "{}/data/transportpce-portmapping:network/nodes={}/node-info"
     response = get_request(url.format('{}', node))
     res = response.json()
-    key = u'transportpce-portmapping:node-info'
+    key = 'transportpce-portmapping:node-info'
     if key in res.keys():
         node_info = res[key]
     else:
index b34204ba5a9f521a2ebcca7268068710f44b8d96..9ab4ae2d5efedd27f441a8efed9ad2e78100575c 100644 (file)
@@ -136,6 +136,7 @@ class TransportPCEFulltesting(unittest.TestCase):
         time.sleep(10)
 
     def setUp(self):  # instruction executed before each test method
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
 
     def test_01_connect_xpdrA(self):
index e1236c1fb92640a1c5c17bb7690cd35139a9042e..b6d2612ec63c3d989ac819e75d7e0946136cfdc1 100644 (file)
@@ -9,6 +9,7 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=invalid-name
 # pylint: disable=no-member
 # pylint: disable=too-many-public-methods
 # pylint: disable=too-many-lines
index 7c6771b337957de4820aa49e25013c7e49583388..e20a04a1b4a5af5dffe18b6c4b8fdc127400c768 100644 (file)
@@ -38,22 +38,22 @@ class TransportPCEtesting(unittest.TestCase):
             sample_files_parsed = False
             TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                             "..", "..", "sample_configs", "honeynode-topo.xml")
-            with open(TOPO_BI_DIR_FILE, 'r') as topo_bi_dir:
+            with open(TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as topo_bi_dir:
                 cls.simple_topo_bi_dir_data = topo_bi_dir.read()
 
             TOPO_UNI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                              "..", "..", "sample_configs", "NW-simple-topology.xml")
 
-            with open(TOPO_UNI_DIR_FILE, 'r') as topo_uni_dir:
+            with open(TOPO_UNI_DIR_FILE, 'r', encoding='utf-8') as topo_uni_dir:
                 cls.simple_topo_uni_dir_data = topo_uni_dir.read()
 
             TOPO_UNI_DIR_COMPLEX_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                                      "..", "..", "sample_configs", "NW-for-test-5-4.xml")
-            with open(TOPO_UNI_DIR_COMPLEX_FILE, 'r') as topo_uni_dir_complex:
+            with open(TOPO_UNI_DIR_COMPLEX_FILE, 'r', encoding='utf-8') as topo_uni_dir_complex:
                 cls.complex_topo_uni_dir_data = topo_uni_dir_complex.read()
             PORT_MAPPING_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                              "..", "..", "sample_configs", "pce_portmapping_121.json")
-            with open(PORT_MAPPING_FILE, 'r') as port_mapping:
+            with open(PORT_MAPPING_FILE, 'r', encoding='utf-8') as port_mapping:
                 cls.port_mapping_data = port_mapping.read()
             sample_files_parsed = True
         except PermissionError as err:
index 576ffdadb2e1a0a81fdaf46db039f4600cfcfe12..d4f05705aa49b75b39a1052cf592d4e79be36738 100644 (file)
@@ -8,6 +8,7 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=invalid-name
 # pylint: disable=no-member
 # pylint: disable=too-many-public-methods
 
@@ -36,31 +37,31 @@ class TransportPCE400Gtesting(unittest.TestCase):
             TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                             "..", "..", "sample_configs",
                                             "honeynode-topo400G.json")
-            with open(TOPO_BI_DIR_FILE, 'r') as topo_bi_dir:
+            with open(TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as topo_bi_dir:
                 cls.topo_bi_dir_data = topo_bi_dir.read()
 
             OTN_TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                                 "..", "..", "sample_configs",
                                                 "honeynode-otntopo400G.json")
-            with open(OTN_TOPO_BI_DIR_FILE, 'r') as otn_topo_bi_dir:
+            with open(OTN_TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as otn_topo_bi_dir:
                 cls.otn_topo_bi_dir_data = otn_topo_bi_dir.read()
 
             OTUC4_OTN_TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                                       "..", "..", "sample_configs",
                                                       "honeynode-otntopo400GwithOTUC4.json")
-            with open(OTUC4_OTN_TOPO_BI_DIR_FILE, 'r') as otuc4_otn_topo_bi_dir:
+            with open(OTUC4_OTN_TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as otuc4_otn_topo_bi_dir:
                 cls.otuc4_otn_topo_bi_dir_data = otuc4_otn_topo_bi_dir.read()
 
             ODUC4_OTN_TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                                       "..", "..", "sample_configs",
                                                       "honeynode-otntopo400GwithODUC4.json")
-            with open(ODUC4_OTN_TOPO_BI_DIR_FILE, 'r') as oduc4_otn_topo_bi_dir:
+            with open(ODUC4_OTN_TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as oduc4_otn_topo_bi_dir:
                 cls.oduc4_otn_topo_bi_dir_data = oduc4_otn_topo_bi_dir.read()
 
             PORT_MAPPING_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                              "..", "..", "sample_configs",
                                              "pce_portmapping_71.json")
-            with open(PORT_MAPPING_FILE, 'r') as port_mapping:
+            with open(PORT_MAPPING_FILE, 'r', encoding='utf-8') as port_mapping:
                 cls.port_mapping_data = port_mapping.read()
             sample_files_parsed = True
         except PermissionError as err:
@@ -85,6 +86,7 @@ class TransportPCE400Gtesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):  # instruction executed before each test method
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(1)
 
index 2ca0dd0d2dfc734da4ac8d4955ce6e50304e8177..99e717f59870cbb7bafe93a8de8075104ee7e597 100644 (file)
@@ -39,21 +39,21 @@ class TransportGNPYtesting(unittest.TestCase):
             sample_files_parsed = False
             TOPO_CLLINET_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                              "..", "..", "sample_configs", "gnpy", "clliNetwork.json")
-            with open(TOPO_CLLINET_FILE, 'r') as topo_cllinet:
+            with open(TOPO_CLLINET_FILE, 'r', encoding='utf-8') as topo_cllinet:
                 cls.topo_cllinet_data = topo_cllinet.read()
 
             TOPO_ORDNET_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                             "..", "..", "sample_configs", "gnpy", "openroadmNetwork.json")
-            with open(TOPO_ORDNET_FILE, 'r') as topo_ordnet:
+            with open(TOPO_ORDNET_FILE, 'r', encoding='utf-8') as topo_ordnet:
                 cls.topo_ordnet_data = topo_ordnet.read()
 
             TOPO_ORDTOPO_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                              "..", "..", "sample_configs", "gnpy", "openroadmTopology.json")
-            with open(TOPO_ORDTOPO_FILE, 'r') as topo_ordtopo:
+            with open(TOPO_ORDTOPO_FILE, 'r', encoding='utf-8') as topo_ordtopo:
                 cls.topo_ordtopo_data = topo_ordtopo.read()
             PORT_MAPPING_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                              "..", "..", "sample_configs", "gnpy", "gnpy_portmapping_121.json")
-            with open(PORT_MAPPING_FILE, 'r') as port_mapping:
+            with open(PORT_MAPPING_FILE, 'r', encoding='utf-8') as port_mapping:
                 cls.port_mapping_data = port_mapping.read()
             sample_files_parsed = True
         except PermissionError as err:
index 2d7edd617f4e735f6073c07a15be978dd7a42154..a5be915c28da2e667c69eeb4c3bb0c485bc0e9f3 100644 (file)
@@ -152,6 +152,7 @@ class TransportNbiNotificationstesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):  # instruction executed before each test method
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
 
     def test_01_connect_xpdrA(self):