#NEWLINE# def test_application_needs_stopping( self ) : #NEWLINE# #INDENT# '\n        ``ApplicationNodeDeployer.calculate_changes`` specifies that an\n        application must be stopped when it is running but not desired.\n        ' #NEWLINE# api = ApplicationNodeDeployer ( 'node.example.com' , docker_client = FakeDockerClient ( ) , network = make_memory_network ( ) ) #NEWLINE# to_stop = StopApplication ( application = Application ( name = 'site-example.com' , image = DockerImage . from_string ( 'flocker/wordpress' ) ) ) #NEWLINE# node_state = NodeState ( hostname = api . hostname , applications = { self . application } ) #NEWLINE# result = api . calculate_changes ( desired_configuration = EMPTY , current_cluster_state = DeploymentState ( nodes = [ node_state ] ) , local_state = NodeLocalState ( node_state = node_state ) ) #NEWLINE# expected = sequentially ( changes = [ in_parallel ( changes = [ to_stop ] ) ] ) #NEWLINE# self . assertEqual ( expected , result )