'Expect an error when the snapshot\'s status is not \'available\'.'

def test_create_volume_from_snapshot_status_not_available(self):

    drv = self._driver
    src_volume = self._simple_volume()
    snap_ref = fake_snapshot.fake_snapshot_obj(self.context, volume_name=src_volume.name, display_name=('clone-snap-%s' % src_volume.id), volume_size=src_volume.size, volume_id=src_volume.id, id=self.SNAP_UUID, status='error')
    snap_ref.volume = src_volume
    new_volume = self._simple_volume(size=snap_ref.volume_size)
    self.assertRaises(exception.InvalidSnapshot, drv.create_volume_from_snapshot, new_volume, snap_ref)
