New functional test suite of otn-swith 2.2.1
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test10_tapi.py
index 25a09c2b29b2176749a0595a1ea3439b1cbf5f04..6721a3501df59c841c9541d2c71e8020b6b745c3 100644 (file)
@@ -236,7 +236,7 @@ class TransportTapitesting(unittest.TestCase):
         response = test_utils.post_request(url, data)
         self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
         res = response.json()
-        self.assertNotIn("node", res["output"]["topology"], 'Topology should contain no node')
+        self.assertEqual(len(res["output"]["topology"]["node"]), 1, 'Topology should contain 1 node')
         self.assertNotIn("link", res["output"]["topology"], 'Topology should contain no link')
 
     def test_05_disconnect_roadmb(self):
@@ -250,7 +250,17 @@ class TransportTapitesting(unittest.TestCase):
         time.sleep(10)
 
     def test_07_check_tapi_topos(self):
-        self.test_04_check_tapi_topos()
+        url = "{}/operations/tapi-topology:get-topology-details"
+        data = {
+            "tapi-topology:input": {
+                "tapi-topology:topology-id-or-name": "T0 - Multi-layer topology"
+            }
+        }
+        response = test_utils.post_request(url, data)
+        self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
+        res = response.json()
+        self.assertNotIn("node", res["output"]["topology"], 'Topology should contain no node')
+        self.assertNotIn("link", res["output"]["topology"], 'Topology should contain no link')
 
     def test_08_connect_rdma(self):
         response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))