'``P2PManifestationDeployer.calculate_changes`` specifies that a
dataset will be resized if a dataset which was previously hosted
on this node continues to be on this node but specifies a dataset
maximum_size that differs to the existing dataset size.'

def test_dataset_resize(self):

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