Reintroduce nb-bierman02 support in new func tests
[transportpce.git] / tests / transportpce_tests / 7.1 / test01_portmapping.py
index 7178eaec922a38d9617da8eb44c6558fce4e3bc7..6aed5f30971968dc6c4f8eeed699ad397b9211cf 100644 (file)
 import unittest
 import time
 import requests
+# pylint: disable=wrong-import-order
 import sys
 sys.path.append('transportpce_tests/common')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
 import test_utils_rfc8040  # nopep8
 
 
@@ -37,6 +40,7 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(10)
 
@@ -151,8 +155,8 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
         res = test_utils_rfc8040.portmapping_mc_capa_request("XPDR-A2", "XPDR-mcprofile")
         self.assertEqual(res['status_code'], requests.codes.ok)
         self.assertEqual(res['mc-capabilities'][0]['mc-node-name'], 'XPDR-mcprofile')
-        self.assertEqual(res['mc-capabilities'][0]['center-freq-granularity'], '3.125')
-        self.assertEqual(res['mc-capabilities'][0]['slot-width-granularity'], '6.25')
+        self.assertEqual(str(res['mc-capabilities'][0]['center-freq-granularity']), '3.125')
+        self.assertEqual(str(res['mc-capabilities'][0]['slot-width-granularity']), '6.25')
 
     def test_09_xpdr_device_disconnection(self):
         response = test_utils_rfc8040.unmount_device("XPDR-A2")
@@ -161,20 +165,18 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
     def test_10_xpdr_device_disconnected(self):
         response = test_utils_rfc8040.check_device_connection("XPDR-A2")
         self.assertEqual(response['status_code'], requests.codes.conflict)
-        self.assertIn(
-            {"error-tag": "data-missing",
-             "error-message": "Request could not be completed because the relevant data model content does not exist",
-             "error-type": "protocol"},
-            response['connection-status'])
+        self.assertIn(response['connection-status']['error-type'], ('protocol', 'application'))
+        self.assertEqual(response['connection-status']['error-tag'], 'data-missing')
+        self.assertEqual(response['connection-status']['error-message'],
+                         'Request could not be completed because the relevant data model content does not exist')
 
     def test_11_xpdr_device_not_connected(self):
         response = test_utils_rfc8040.get_portmapping_node_info("XPDR-A2")
         self.assertEqual(response['status_code'], requests.codes.conflict)
-        self.assertIn(
-            {"error-tag": "data-missing",
-             "error-message": "Request could not be completed because the relevant data model content does not exist",
-             "error-type": "protocol"},
-            response['node-info'])
+        self.assertIn(response['node-info']['error-type'], ('protocol', 'application'))
+        self.assertEqual(response['node-info']['error-tag'], 'data-missing')
+        self.assertEqual(response['node-info']['error-message'],
+                         'Request could not be completed because the relevant data model content does not exist')
 
 
 if __name__ == '__main__':