def setUp(self): self.config = get_config() self.proxy = FakeProxy() self.config.registry['proxy'] = self.proxy self.app = self.config.make_wsgi_app() self.client = webtest.TestApp(self.app)
def start_vaurien_httpserver(port): """Start a vaurien httpserver, controlling a fake proxy""" config = get_config() config.registry['proxy'] = FakeProxy() server = WSGIServer(('localhost', int(port)), config.make_wsgi_app(), log=None) server.serve_forever()
def start_vaurien_httpserver(port): """Start a vaurien httpserver, controlling a fake proxy""" config = get_config() config.registry['proxy'] = FakeProxy() server = WSGIServer(('localhost', int(port)), config.make_wsgi_app(), log=None) server.serve_forever()
statsd = get_statsd_from_settings(settings.getsection('statsd')) # creating the proxy proxy_args = dict(proxy=settings['vaurien.proxy'], backend=settings['vaurien.backend'], settings=settings, statsd=statsd, logger=logger, protocol=args.protocol) if args.http: # if we are using the http server, then we want to use the OnTheFly # proxy proxy = OnTheFlyProxy(**proxy_args) from vaurien.webserver import get_config from gevent.pywsgi import WSGIServer config = get_config() config.registry['proxy'] = proxy app = config.make_wsgi_app() # configure the web app logger # configure_logger(app.logger, args.loglevel, args.logoutput) # app.run(host=args.http_host, port=args.http_port) http_server = WSGIServer((args.http_host, args.http_port), app, log=DevNull()) http_server.start() logger.info('Started the HTTP server: http://%s:%s' % (args.http_host, args.http_port)) else: # per default, we want to randomize
# creating the proxy proxy_args = dict(proxy=settings['vaurien.proxy'], backend=settings['vaurien.backend'], settings=settings, statsd=statsd, logger=logger, protocol=args.protocol) if args.http: # if we are using the http server, then we want to use the OnTheFly # proxy proxy = OnTheFlyProxy(**proxy_args) from vaurien.webserver import get_config from gevent.pywsgi import WSGIServer config = get_config() config.registry['proxy'] = proxy app = config.make_wsgi_app() # configure the web app logger # configure_logger(app.logger, args.loglevel, args.logoutput) # app.run(host=args.http_host, port=args.http_port) http_server = WSGIServer((args.http_host, args.http_port), app, log=DevNull()) http_server.start() logger.info('Started the HTTP server: http://%s:%s' % (args.http_host, args.http_port)) else: