fix some pylint issues
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test_gnpy.py
index de8e19f2a8c7bc12df11e2cf2657d740546d25f8..80a92bf0dc1146f0c0ded39da425880431e7d828 100644 (file)
@@ -13,7 +13,6 @@
 # pylint: disable=too-many-public-methods
 
 import unittest
-import json
 import os
 import sys
 import time
@@ -23,13 +22,6 @@ from common import test_utils
 
 class TransportGNPYtesting(unittest.TestCase):
 
-    @classmethod
-    def __init_logfile(cls):
-        GNPY_LOGFILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
-                                    "..", "..", "transportpce_tests", "gnpy.log")
-        if os.path.isfile(GNPY_LOFGILE):
-            os.remove(GNPY_LOFGILE)
-
     topo_cllinet_data = None
     topo_ordnet_data = None
     topo_ordtopo_data = None
@@ -37,6 +29,7 @@ class TransportGNPYtesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
+        # pylint: disable=bare-except
         try:
             sample_files_parsed = False
             TOPO_CLLINET_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
@@ -71,6 +64,7 @@ class TransportGNPYtesting(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")
@@ -127,7 +121,8 @@ class TransportGNPYtesting(unittest.TestCase):
                                                        {"include_": {"ordered-hops": [
                                                            {"hop-number": "0", "hop-type": {"node-id": "OpenROADM-2"}},
                                                            {"hop-number": "1", "hop-type": {"node-id": "OpenROADM-3"}},
-                                                           {"hop-number": "2", "hop-type": {"node-id": "OpenROADM-4"}}]}})
+                                                           {"hop-number": "2", "hop-type": {"node-id": "OpenROADM-4"}}]}
+                                                        })
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(res['output']['configuration-response-common'][
@@ -154,7 +149,8 @@ class TransportGNPYtesting(unittest.TestCase):
                                                            "service-format": "Ethernet", "clli": "Node5"},
                                                        {"include_": {"ordered-hops": [
                                                            {"hop-number": "0", "hop-type": {"node-id": "OpenROADM-2"}},
-                                                           {"hop-number": "1", "hop-type": {"node-id": "OpenROADM-3"}}]}})
+                                                           {"hop-number": "1", "hop-type": {"node-id": "OpenROADM-3"}}]}
+                                                        })
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(res['output']['configuration-response-common'][
@@ -181,7 +177,8 @@ class TransportGNPYtesting(unittest.TestCase):
                                                            {"hop-number": "0", "hop-type": {"node-id": "OpenROADM-2"}},
                                                            {"hop-number": "1", "hop-type": {"node-id": "OpenROADM-3"}},
                                                            {"hop-number": "2", "hop-type": {"node-id": "OpenROADM-4"}},
-                                                           {"hop-number": "3", "hop-type": {"node-id": "OpenROADM-3"}}]}})
+                                                           {"hop-number": "3", "hop-type": {"node-id": "OpenROADM-3"}}]}
+                                                        })
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(res['output']['configuration-response-common'][