'``P2PManifestationDeployer.calculate_changes`` specifies that a
dataset must be deleted if the desired configuration specifies
that the dataset has the ``deleted`` attribute set to True.
Note that for now this happens regardless of whether the node
actually has the dataset, since the deployer doesn\'t know about
replicas... see FLOC-1240.'

def test_dataset_deleted(self):

    node_state = NodeState(hostname=u'10.1.1.1', manifestations={MANIFESTATION.dataset_id: MANIFESTATION}, devices={}, paths={}, applications=[])
    api = P2PManifestationDeployer(node_state.hostname, create_volume_service(self))
    current = DeploymentState(nodes=[node_state])
    desired = Deployment(nodes=[Node(hostname=api.hostname, manifestations=node_state.manifestations.transform((DATASET_ID, 'dataset', 'deleted'), True))])
    changes = api.calculate_changes(desired, current, NodeLocalState(node_state=node_state))
    expected = sequentially(changes=[in_parallel(changes=[DeleteDataset(dataset=DATASET.set('deleted', True))])])
    self.assertEqual(expected, changes)
