'Tests the case where driver.extend_volume tries to extend
a volume not attached to the specified instance.'

def test_extend_volume_volume_not_found(self):

    inst_obj = objects.Instance(id=3, uuid=uuids.instance)
    @mock.patch.object(objects.BlockDeviceMapping, 'get_by_volume_and_instance', side_effect=exception.NotFound())
    def do_test(bdm_get_by_vol_and_inst):
        self.compute.extend_volume(self.context, inst_obj, uuids.volume_id)
    do_test()
