def test_run_app(self, m): random_port = random.randrange(1024, 65536) oslo.config.cfg.CONF.set_override('port', random_port, group='api') oslo.config.cfg.CONF.set_override('host', '127.0.0.1', group='api') d = app.build_server(self._make_app()) self.assertEqual(('127.0.0.1', random_port), d.server_address)
def main(): service.prepare_service() srv = app.build_server() srv.serve_forever()