def test_stop_already_stopped(self): """Calling stop on a non-running router should not raise any exceptions""" config = self.create_router_config() router = Router(self.api, config) router.start(self.service) self.assertIn(router.id, self.service.namedServices) yield router.stop() self.assertNotIn(router.id, self.service.namedServices) yield router.stop()
def test_stop(self): """stop should stop the router worker if it is running""" config = self.create_router_config() router = Router(self.api, config) router.start(self.service) self.assertIn(router.id, self.service.namedServices) yield router.stop() self.assertNotIn(router.id, self.service.namedServices)