#NEWLINE# def test_restart_policy( self ) : #NEWLINE# #INDENT# "\n        ``StartApplication.run()`` passes ``RestartNever`` to\n        ``DockerClient.add`` which is used when creating a Unit.\n\n        It doesn't pass the ``Application``\\ 's ``restart_policy`` because\n        ``RestartNever`` is the only implemented policy.  See FLOC-2449.\n        " #NEWLINE# policy = RestartAlways ( ) #NEWLINE# fake_docker = FakeDockerClient ( ) #NEWLINE# deployer = ApplicationNodeDeployer ( 'example.com' , fake_docker ) #NEWLINE# application_name = 'site-example.com' #NEWLINE# application = Application ( name = application_name , image = DockerImage ( repository = 'clusterhq/postgresql' , tag = '9.3.5' ) , restart_policy = policy ) #NEWLINE# StartApplication ( application = application , node_state = EMPTY_NODESTATE ) . run ( deployer , state_persister = InMemoryStatePersister ( ) ) #NEWLINE# [ unit ] = self . successResultOf ( fake_docker . list ( ) ) #NEWLINE# self . assertEqual ( unit . restart_policy , RestartNever ( ) )