def setUp(self):
     self._app = get_app()  # Generate a random server configuration.
     self.client = MarathonClient(MARATHON_SERVER)
     self.client.create_app(app_id=self._app.id, app=self._app)
     time.sleep(2)  # Wait two seconds for the POST to be processed by Marathon.
     self.app = self.client.get_app(self._app.id)
     while not self.app.tasks_healthy:  # Wait until the app becomes healthy.
         self.app = self.client.get_app(self._app.id)
         time.sleep(1)
 def setUp(self):
     self.app = get_app()
     self.factory = EventFactory()
     self.client = MarathonClient(servers=[MARATHON_SERVER])
     self.client.create_event_subscription(url=MARATHON_CALLBACK_URL)