diff --git a/ironic_tempest_plugin/tests/api/admin/base.py b/ironic_tempest_plugin/tests/api/admin/base.py index cc3636b998..0e3f59e2d5 100644 --- a/ironic_tempest_plugin/tests/api/admin/base.py +++ b/ironic_tempest_plugin/tests/api/admin/base.py @@ -118,6 +118,13 @@ class BaseBaremetalTest(api_version_utils.BaseMicroversionTest, finally: super(BaseBaremetalTest, cls).resource_cleanup() + def _assertExpected(self, expected, actual): + """Check if not expected keys/values exist in actual response body.""" + for key, value in expected.items(): + if key not in ('created_at', 'updated_at'): + self.assertIn(key, actual) + self.assertEqual(value, actual[key]) + def setUp(self): super(BaseBaremetalTest, self).setUp() self.useFixture(api_microversion_fixture.APIMicroversionFixture( diff --git a/ironic_tempest_plugin/tests/api/admin/test_chassis.py b/ironic_tempest_plugin/tests/api/admin/test_chassis.py index 52109e0ff7..78912a25b2 100644 --- a/ironic_tempest_plugin/tests/api/admin/test_chassis.py +++ b/ironic_tempest_plugin/tests/api/admin/test_chassis.py @@ -26,13 +26,6 @@ class TestChassis(base.BaseBaremetalTest): super(TestChassis, cls).resource_setup() _, cls.chassis = cls.create_chassis() - def _assertExpected(self, expected, actual): - # Check if not expected keys/values exists in actual response body - for key, value in expected.items(): - if key not in ('created_at', 'updated_at'): - self.assertIn(key, actual) - self.assertEqual(value, actual[key]) - @decorators.idempotent_id('7c5a2e09-699c-44be-89ed-2bc189992d42') def test_create_chassis(self): descr = data_utils.rand_name('test-chassis') diff --git a/ironic_tempest_plugin/tests/api/admin/test_nodes.py b/ironic_tempest_plugin/tests/api/admin/test_nodes.py index 8f1b0da0a5..411269834c 100644 --- a/ironic_tempest_plugin/tests/api/admin/test_nodes.py +++ b/ironic_tempest_plugin/tests/api/admin/test_nodes.py @@ -29,13 +29,6 @@ class TestNodes(base.BaseBaremetalTest): _, self.chassis = self.create_chassis() _, self.node = self.create_node(self.chassis['uuid']) - def _assertExpected(self, expected, actual): - # Check if not expected keys/values exists in actual response body - for key, value in expected.items(): - if key not in ('created_at', 'updated_at'): - self.assertIn(key, actual) - self.assertEqual(value, actual[key]) - def _associate_node_with_instance(self): self.client.set_node_power_state(self.node['uuid'], 'power off') waiters.wait_for_bm_node_status(self.client, self.node['uuid'], diff --git a/ironic_tempest_plugin/tests/api/admin/test_ports.py b/ironic_tempest_plugin/tests/api/admin/test_ports.py index ed2e911452..fe10573884 100644 --- a/ironic_tempest_plugin/tests/api/admin/test_ports.py +++ b/ironic_tempest_plugin/tests/api/admin/test_ports.py @@ -28,13 +28,6 @@ class TestPorts(base.BaseBaremetalTest): _, self.port = self.create_port(self.node['uuid'], data_utils.rand_mac_address()) - def _assertExpected(self, expected, actual): - # Check if not expected keys/values exists in actual response body - for key, value in expected.items(): - if key not in ('created_at', 'updated_at'): - self.assertIn(key, actual) - self.assertEqual(value, actual[key]) - @decorators.idempotent_id('83975898-2e50-42ed-b5f0-e510e36a0b56') def test_create_port(self): node_id = self.node['uuid']