#NEWLINE# def test_environment_supplied_to_docker( self ) : #NEWLINE# #INDENT# '\n        ``StartApplication.run()`` passes the environment dictionary of the\n        application to ``DockerClient.add`` as an ``Environment`` instance.\n        ' #NEWLINE# fake_docker = FakeDockerClient ( ) #NEWLINE# deployer = ApplicationNodeDeployer ( 'example.com' , fake_docker ) #NEWLINE# application_name = 'site-example.com' #NEWLINE# variables = frozenset ( { #NEWLINE# #INDENT# 'foo' : 'bar' , #NEWLINE# 'baz' : 'qux' , #NEWLINE# #UNINDENT# } . iteritems ( ) ) #NEWLINE# application = Application ( name = application_name , image = DockerImage ( repository = 'clusterhq/postgresql' , tag = '9.3.5' ) , environment = variables . copy ( ) , links = frozenset ( ) , ports = ( ) ) #NEWLINE# StartApplication ( application = application , node_state = EMPTY_NODESTATE ) . run ( deployer , state_persister = InMemoryStatePersister ( ) ) #NEWLINE# expected_environment = Environment ( variables = variables . copy ( ) ) #NEWLINE# self . assertEqual ( expected_environment , fake_docker . _units [ application_name ] . environment )