#NEWLINE# def test_already_exists( self ) : #NEWLINE# #INDENT# '\n        ``StartApplication.run`` returns a `Deferred` which errbacks with\n        an ``AlreadyExists`` error if there is already a unit with the supplied\n        application name.\n        ' #NEWLINE# api = ApplicationNodeDeployer ( 'example.com' , docker_client = FakeDockerClient ( ) ) #NEWLINE# application = Application ( name = b'site-example.com' , image = DockerImage ( repository = 'clusterhq/flocker' , tag = 'release-14.0' ) , links = frozenset ( ) ) #NEWLINE# result1 = StartApplication ( application = application , node_state = EMPTY_NODESTATE ) . run ( api , state_persister = InMemoryStatePersister ( ) ) #NEWLINE# self . successResultOf ( result1 ) #NEWLINE# result2 = StartApplication ( application = application , node_state = EMPTY_NODESTATE ) . run ( api , state_persister = InMemoryStatePersister ( ) ) #NEWLINE# self . failureResultOf ( result2 , AlreadyExists )