Adapt TransportPCE code to Sulfur
[transportpce.git] / tests / transportpce_tests / hybrid / test01_device_change_notifications.py
index 9ab4ae2d5efedd27f441a8efed9ad2e78100575c..2d68f7b0354fa71542c4eab789578a1889061e92 100644 (file)
@@ -40,36 +40,8 @@ class TransportPCEFulltesting(unittest.TestCase):
             "node-id": "XPDRA01",
             "service-format": "Ethernet",
             "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "1/0/C1",
-                            "port-type": "fixed",
-                            "port-name": "1",
-                            "port-rack": "000000.00",
-                            "port-shelf": "Chassis#1"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "Some lgx-device-name",
-                            "lgx-port-name": "Some lgx-port-name",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-            "rx-direction": {
-                        "port": {
-                            "port-device-name": "1/0/C1",
-                            "port-type": "fixed",
-                            "port-name": "1",
-                            "port-rack": "000000.00",
-                            "port-shelf": "Chassis#1"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "Some lgx-device-name",
-                            "lgx-port-name": "Some lgx-port-name",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
+            "tx-direction": [{"index": 0}],
+            "rx-direction": [{"index": 0}],
             "optic-type": "gray"
         },
         "service-z-end": {
@@ -77,36 +49,8 @@ class TransportPCEFulltesting(unittest.TestCase):
             "node-id": "XPDR-C1",
             "service-format": "Ethernet",
             "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "1/0/C1",
-                            "port-type": "fixed",
-                            "port-name": "1",
-                            "port-rack": "000000.00",
-                            "port-shelf": "Chassis#1"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "Some lgx-device-name",
-                            "lgx-port-name": "Some lgx-port-name",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-            "rx-direction": {
-                        "port": {
-                            "port-device-name": "1/0/C1",
-                            "port-type": "fixed",
-                            "port-name": "1",
-                            "port-rack": "000000.00",
-                            "port-shelf": "Chassis#1"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "Some lgx-device-name",
-                            "lgx-port-name": "Some lgx-port-name",
-                            "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",
@@ -723,8 +667,7 @@ class TransportPCEFulltesting(unittest.TestCase):
         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)