Fix new pylint issues in functional tests
[transportpce.git] / tests / transportpce_tests / with_docker / test02_nbinotifications.py
index 2d7edd617f4e735f6073c07a15be978dd7a42154..5e5edfae16bb6324feb5c3a60d98e7cced884777 100644 (file)
@@ -25,7 +25,7 @@ import test_utils  # nopep8
 
 
 class TransportNbiNotificationstesting(unittest.TestCase):
-    processes = None
+    processes = []
     cr_serv_sample_data = {"input": {
         "sdnc-request-header": {
             "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
@@ -41,36 +41,8 @@ class TransportNbiNotificationstesting(unittest.TestCase):
             "node-id": "XPDR-A1",
             "service-format": "Ethernet",
             "clli": "SNJSCAMCJP8",
-            "tx-direction": {
-                "port": {
-                    "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                    "port-type": "router",
-                    "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                    "port-rack": "000000.00",
-                    "port-shelf": "00"
-                },
-                "lgx": {
-                    "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                    "lgx-port-name": "LGX Back.3",
-                    "lgx-port-rack": "000000.00",
-                    "lgx-port-shelf": "00"
-                }
-            },
-            "rx-direction": {
-                "port": {
-                    "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                    "port-type": "router",
-                    "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                    "port-rack": "000000.00",
-                    "port-shelf": "00"
-                },
-                "lgx": {
-                    "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                    "lgx-port-name": "LGX Back.4",
-                    "lgx-port-rack": "000000.00",
-                    "lgx-port-shelf": "00"
-                }
-            },
+            "tx-direction": [{"index": 0}],
+            "rx-direction": [{"index": 0}],
             "optic-type": "gray"
         },
         "service-z-end": {
@@ -78,36 +50,8 @@ class TransportNbiNotificationstesting(unittest.TestCase):
             "node-id": "XPDR-C1",
             "service-format": "Ethernet",
             "clli": "SNJSCAMCJT4",
-            "tx-direction": {
-                "port": {
-                    "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                    "port-type": "router",
-                    "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                    "port-rack": "000000.00",
-                    "port-shelf": "00"
-                },
-                "lgx": {
-                    "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                    "lgx-port-name": "LGX Back.29",
-                    "lgx-port-rack": "000000.00",
-                    "lgx-port-shelf": "00"
-                }
-            },
-            "rx-direction": {
-                "port": {
-                    "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                    "port-type": "router",
-                    "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                    "port-rack": "000000.00",
-                    "port-shelf": "00"
-                },
-                "lgx": {
-                    "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                    "lgx-port-name": "LGX Back.30",
-                    "lgx-port-rack": "000000.00",
-                    "lgx-port-shelf": "00"
-                }
-            },
+            "tx-direction": [{"index": 0}],
+            "rx-direction": [{"index": 0}],
             "optic-type": "gray"
         },
         "due-date": "2016-11-28T00:00:01Z",
@@ -120,6 +64,7 @@ class TransportNbiNotificationstesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
+        # pylint: disable=unsubscriptable-object
         # TODO: for lighty manage the activation of NBI notification feature
         cls.init_failed = False
         cls.processes = test_utils.start_tpce()
@@ -152,6 +97,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):
@@ -340,7 +286,8 @@ class TransportNbiNotificationstesting(unittest.TestCase):
             "port-qual": "roadm-external"}]}
         response = requests.request("PUT", url.format("http://127.0.0.1:8141/restconf"),
                                     data=json.dumps(body), headers=test_utils.TYPE_APPLICATION_JSON,
-                                    auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
+                                    auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD),
+                                    timeout=test_utils.REQUEST_TIMEOUT)
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(2)
 
@@ -372,7 +319,8 @@ class TransportNbiNotificationstesting(unittest.TestCase):
             "port-qual": "roadm-external"}]}
         response = requests.request("PUT", url.format("http://127.0.0.1:8141/restconf"),
                                     data=json.dumps(body), headers=test_utils.TYPE_APPLICATION_JSON,
-                                    auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
+                                    auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD),
+                                    timeout=test_utils.REQUEST_TIMEOUT)
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(2)