'``P2PManifestationDeployer.calculate_changes`` specifies that a volume
was previously running on this node but is now running on another
node must be handed off.'

def test_volume_handoff(self):

    node_state = NodeState(hostname=u'node1.example.com', manifestations={MANIFESTATION.dataset_id: MANIFESTATION}, devices={}, paths={}, applications=[])
    another_node_state = NodeState(hostname=u'node2.example.com', manifestations={}, devices={}, paths={})
    current = DeploymentState(nodes=[node_state, another_node_state])
    desired = Deployment(nodes={Node(hostname=node_state.hostname), Node(hostname=another_node_state.hostname, manifestations={MANIFESTATION.dataset_id: MANIFESTATION})})
    api = P2PManifestationDeployer(node_state.hostname, create_volume_service(self))
    changes = api.calculate_changes(desired, current, NodeLocalState(node_state=node_state))
    volume = APPLICATION_WITH_VOLUME.volume
    expected = sequentially(changes=[in_parallel(changes=[HandoffDataset(dataset=volume.dataset, hostname=another_node_state.hostname)])])
    self.assertEqual(expected, changes)
