'If a dataset exists but is not manifest anywhere in the cluster and the
configuration specifies it should be manifest on the deployer\'s node,
``BlockDeviceDeployer.calculate_changes`` returns state changes to
attach that dataset to its node and then mount its filesystem.'

def test_attach_existing_nonmanifest(self):

    deployer = create_blockdevicedeployer(self, hostname=self.NODE, node_uuid=self.NODE_UUID)
    node_config = to_node(self.ONE_DATASET_STATE)
    cluster_config = Deployment(nodes={node_config})
    node_state = self.ONE_DATASET_STATE.transform(['manifestations', unicode(self.DATASET_ID)], discard).transform(['devices', self.DATASET_ID], discard)
    manifestation = node_config.manifestations[unicode(self.DATASET_ID)]
    dataset = manifestation.dataset
    nonmanifest_datasets = {unicode(dataset.dataset_id): dataset}
    cluster_state = DeploymentState(nodes={node_state}, nonmanifest_datasets=nonmanifest_datasets)
    local_state = local_state_from_shared_state(node_state=node_state, nonmanifest_datasets=cluster_state.nonmanifest_datasets)
    changes = deployer.calculate_changes(cluster_config, cluster_state, local_state)
    self.assertEqual(in_parallel(changes=[AttachVolume(dataset_id=UUID(dataset.dataset_id), blockdevice_id=_create_blockdevice_id_for_test(dataset.dataset_id))]), changes)
