def test_validate_instance_and_node(self, mock_gbiui): node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' instance_uuid = uuidutils.generate_uuid() node = ironic_utils.get_test_node(uuid=node_uuid, instance_uuid=instance_uuid) instance = fake_instance.fake_instance_obj(self.ctx, uuid=instance_uuid) icli = cw.IronicClientWrapper() mock_gbiui.return_value = node result = ironic_driver.validate_instance_and_node(icli, instance) self.assertEqual(result.uuid, node_uuid)
def test_validate_instance_and_node(self): node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' instance_uuid = uuidutils.generate_uuid() node = ironic_utils.get_test_node(uuid=node_uuid, instance_uuid=instance_uuid) instance = fake_instance.fake_instance_obj(self.ctx, uuid=instance_uuid) icli = cw.IronicClientWrapper() with mock.patch.object(FAKE_CLIENT.node, 'get_by_instance_uuid') \ as mock_gbiui: mock_gbiui.return_value = node result = ironic_driver.validate_instance_and_node(icli, instance) self.assertEqual(result.uuid, node_uuid)