fix some pylint issues
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test_gnpy.py
index 20e7d7578a63cfa44f1972cc85932177db8e8140..80a92bf0dc1146f0c0ded39da425880431e7d828 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 os
 import sys
 import time
@@ -20,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
@@ -34,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__)),
@@ -68,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")
@@ -124,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'][
@@ -151,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'][
@@ -178,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'][