'``P2PManifestationDeployer.calculate_changes`` specifies that a
dataset will be resized if it is to be relocated to a different
node but specifies a maximum_size that differs to the existing
size. The dataset will be resized before moving.'

def test_dataset_resized_before_move(self):

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