#NEWLINE# def test_desired_open_ports_remain( self ) : #NEWLINE# #INDENT# '\n        Open ports which exist on the node and which are still required are not\n        removed.\n        ' #NEWLINE# fake_network = make_memory_network ( ) #NEWLINE# fake_network . open_port ( port = 3305 ) #NEWLINE# required_open_port_1 = fake_network . open_port ( port = 3306 ) #NEWLINE# required_open_port_2 = fake_network . open_port ( port = 8080 ) #NEWLINE# api = ApplicationNodeDeployer ( 'example.com' , docker_client = FakeDockerClient ( ) , network = api ) #NEWLINE# state_change = OpenPorts ( ports = [ required_open_port_1 , required_open_port_2 ] ) #NEWLINE# d = state_change . run ( api , state_persister = InMemoryStatePersister ( ) ) #NEWLINE# self . successResultOf ( d ) #NEWLINE# self . assertEqual ( set ( [ required_open_port_1 , required_open_port_2 ] ) , set ( fake_network . enumerate_open_ports ( ) ) )