'``P2PManifestationDeployer.calculate_changes`` ensures dataset
deletion happens only if there is no application using the deleted
dataset.
This will eventually be switched to use a lease system, rather
than inspecting application configuration.'

def test_no_resize_if_in_use(self):

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