diff --git a/ironic/tests/unit/api/v1/test_nodes.py b/ironic/tests/unit/api/v1/test_nodes.py index 9a100a8ce9..7e21f21fe4 100644 --- a/ironic/tests/unit/api/v1/test_nodes.py +++ b/ironic/tests/unit/api/v1/test_nodes.py @@ -536,8 +536,7 @@ class TestListNodes(test_api_base.BaseApiTest): def test_associated_nodes_insensitive(self): associated_nodes = (self - ._create_association_test_nodes() - .get('associated')) + ._create_association_test_nodes()['associated']) data = self.get_json('/nodes?associated=true') data1 = self.get_json('/nodes?associated=True') @@ -555,9 +554,8 @@ class TestListNodes(test_api_base.BaseApiTest): self.assertTrue(response.json['error_message']) def test_unassociated_nodes_insensitive(self): - unassociated_nodes = (self - ._create_association_test_nodes() - .get('unassociated')) + unassociated_nodes = ( + self._create_association_test_nodes()['unassociated']) data = self.get_json('/nodes?associated=false') data1 = self.get_json('/nodes?associated=FALSE') @@ -568,9 +566,8 @@ class TestListNodes(test_api_base.BaseApiTest): self.assertEqual(sorted(unassociated_nodes), sorted(uuids)) def test_unassociated_nodes_with_limit(self): - unassociated_nodes = (self - ._create_association_test_nodes() - .get('unassociated')) + unassociated_nodes = ( + self._create_association_test_nodes()['unassociated']) data = self.get_json('/nodes?associated=False&limit=2') @@ -585,8 +582,7 @@ class TestListNodes(test_api_base.BaseApiTest): def test_detail_with_association_filter(self): associated_nodes = (self - ._create_association_test_nodes() - .get('associated')) + ._create_association_test_nodes()['associated']) data = self.get_json('/nodes/detail?associated=true') self.assertIn('driver', data['nodes'][0]) self.assertEqual(len(associated_nodes), len(data['nodes'])) diff --git a/ironic/tests/unit/conductor/test_manager.py b/ironic/tests/unit/conductor/test_manager.py index bcd4ff5283..ac287fe392 100644 --- a/ironic/tests/unit/conductor/test_manager.py +++ b/ironic/tests/unit/conductor/test_manager.py @@ -1491,7 +1491,7 @@ class DoNodeCleanTestCase(mgr_utils.ServiceSetUpMixin, # Node will be moved to CLEANING self.assertEqual(states.CLEANING, node.provision_state) self.assertEqual(states.MANAGEABLE, node.target_provision_state) - self.assertIsNone(node.driver_internal_info.get('clean_steps')) + self.assertNotIn('clean_steps', node.driver_internal_info) self.assertIsNone(node.last_error) @mock.patch('ironic.conductor.manager.ConductorManager._spawn_worker') @@ -1719,8 +1719,8 @@ class DoNodeCleanTestCase(mgr_utils.ServiceSetUpMixin, self.assertEqual(states.AVAILABLE, node.provision_state) self.assertEqual(states.NOSTATE, node.target_provision_state) self.assertEqual({}, node.clean_step) - self.assertIsNone(node.driver_internal_info.get('clean_steps')) - self.assertIsNone(node.driver_internal_info.get('clean_step_index')) + self.assertNotIn('clean_steps', node.driver_internal_info) + self.assertNotIn('clean_step_index', node.driver_internal_info) @mock.patch('ironic.drivers.modules.fake.FakeDeploy.prepare_cleaning') def __do_node_clean_prepare_clean_fail(self, mock_prep, clean_steps=None):