'If there is already a backend volume for a dataset when it is created,
that volume is used for that dataset.'

@require_cluster(1)
def test_unregistered_volume(self, cluster):

    api = get_backend_api(cluster.cluster_uuid)
    dataset_id = uuid4()
    volume = api.create_volume(dataset_id, size=get_default_volume_size())
    wait_for_dataset = create_dataset(self, cluster, dataset_id=dataset_id)
    def check_volumes(dataset):
        new_volumes = api.list_volumes()
        self.assertThat(new_volumes, MatchesListwise([AfterPreprocessing((lambda new_volume: new_volume.set('attached_to', None)), Equals(volume))]))
    wait_for_dataset.addCallback(check_volumes)
    return wait_for_dataset
