'``ApplicationNodeDeployer.calculate_changes`` specifies that
all applications on a node must be stopped if the desired
configuration does not include that node.'

def test_node_not_described(self):

    api = ApplicationNodeDeployer(u'node.example.com', docker_client=FakeDockerClient())
    application = Application(name=u'my-db', image=DockerImage.from_string('postgres'))
    desired = Deployment(nodes=frozenset())
    node_state = NodeState(hostname=api.hostname, applications=[application])
    result = api.calculate_changes(desired_configuration=desired, current_cluster_state=DeploymentState(nodes=[node_state]), local_state=NodeLocalState(node_state=node_state))
    to_stop = StopApplication(application=application)
    expected = sequentially(changes=[in_parallel(changes=[to_stop])])
    self.assertEqual(expected, result)
