X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2F1.2.1%2Ftest01_portmapping.py;h=a595bd555fb76d80c61b9195b4afb0e3ed63a363;hb=819d009eb8f97c15bdf074e132612f17f2e4fbc1;hp=013004c379f155a84bee47b05d399976ca5d5759;hpb=b6cfae23636d24db5c63a32a5dad57de1c94327b;p=transportpce.git diff --git a/tests/transportpce_tests/1.2.1/test01_portmapping.py b/tests/transportpce_tests/1.2.1/test01_portmapping.py index 013004c37..a595bd555 100644 --- a/tests/transportpce_tests/1.2.1/test01_portmapping.py +++ b/tests/transportpce_tests/1.2.1/test01_portmapping.py @@ -15,8 +15,11 @@ 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 @@ -38,6 +41,7 @@ class TransportPCEPortMappingTesting(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) @@ -190,20 +194,18 @@ class TransportPCEPortMappingTesting(unittest.TestCase): def test_17_xpdr_device_disconnected(self): response = test_utils_rfc8040.check_device_connection("XPDRA01") 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_18_xpdr_device_not_connected(self): response = test_utils_rfc8040.get_portmapping_node_info("XPDRA01") 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') def test_19_rdm_device_disconnection(self): response = test_utils_rfc8040.unmount_device("ROADMA01") @@ -212,20 +214,18 @@ class TransportPCEPortMappingTesting(unittest.TestCase): def test_20_rdm_device_disconnected(self): response = test_utils_rfc8040.check_device_connection("ROADMA01") 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_21_rdm_device_not_connected(self): response = test_utils_rfc8040.get_portmapping_node_info("ROADMA01") 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__":