def test_stop(self):
        fake_docker = FakeDockerClient()
        api = ApplicationNodeDeployer(u'example.com',
                                      docker_client=fake_docker)
        application = Application(
            name=b'site-example.com',
            image=DockerImage(repository=u'clusterhq/flocker',
                              tag=u'release-14.0'),
            links=frozenset(),
        )

        StartApplication(
            application=application,
            node_state=EMPTY_NODESTATE
        ).run(api, state_persister=InMemoryStatePersister())
        existed = fake_docker.exists(application.name)
        stop_result = StopApplication(
            application=application,
        ).run(api, state_persister=InMemoryStatePersister())
        exists_result = fake_docker.exists(unit_name=application.name)

        self.assertEqual(
            (None, True, False),
            (self.successResultOf(stop_result),
             self.successResultOf(existed),
             self.successResultOf(exists_result))
        )
``StopApplication`` accepts an application object and when ``run()``
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/test/test_container.py/StopApplicationTests.test_stop