def setup_class(cls): super(TestRewriterApp, cls).setup_class() #cls.app = RWApp.create_app(replay_port=cls.server.port) #cls.testapp = webtest.TestApp(cls.app.app) cls.testapp = webtest.TestApp( FrontEndApp(custom_config=LIVE_CONFIG, config_file=None))
def load(self): from pywb.apps.frontendapp import FrontEndApp self.r.live = True super(LiveCli, self).load() return FrontEndApp(config_file=None, custom_config=self.extra_config)
def setup_class(cls, coll='pywb', config_file='config_test.yaml', recording=False, proxy_opts={}, config_opts={}): super(BaseTestProxy, cls).setup_class() config_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), config_file) cls.root_ca_file = os.path.join(cls.root_dir, 'pywb-ca-test.pem') opts = { 'ca_name': 'pywb test HTTPS Proxy CA', 'ca_file_cache': cls.root_ca_file, 'coll': coll, 'recording': recording, } opts.update(proxy_opts) custom_config = config_opts custom_config['proxy'] = opts cls.app = FrontEndApp(config_file=config_file, custom_config=custom_config) cls.server = GeventServer(cls.app, handler_class=RequestURIWSGIHandler) cls.proxies = cls.proxy_dict(cls.server.port)
def replay_url(self, url=None): application = FrontEndApp( config_file='config/config.yaml', custom_config={ 'debug': True, 'framed_replay': False}) client = Client(application, BaseResponse) return client.get(self.get_replay_url(url=url), follow_redirects=True)
def setup_class(cls, coll='pywb', config_file='config_test.yaml', recording=False): super(BaseTestProxy, cls).setup_class() config_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), config_file) cls.root_ca_file = os.path.join(cls.root_dir, 'pywb-ca-test.pem') opts = { 'ca_name': 'pywb test HTTPS Proxy CA', 'ca_file_cache': cls.root_ca_file, 'coll': coll, 'recording': recording, } cls.app = FrontEndApp(config_file=config_file, custom_config={'proxy': opts}) cls.server = GeventServer(cls.app) cls.proxies = cls.proxy_dict(cls.server.port)
from gevent.monkey import patch_all patch_all() from pywb.apps.frontendapp import FrontEndApp application = FrontEndApp(config_file=None, custom_config={'collections': { 'live': '$live' }})
import os from werkzeug.wsgi import DispatcherMiddleware from django.core.wsgi import get_wsgi_application from django.conf import settings from pywb.apps.frontendapp import FrontEndApp from dashboard.handler import WSHandler os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") application = DispatcherMiddleware( get_wsgi_application(), { '/websocket': WSHandler, settings.ARCHIVES_ROUTE: FrontEndApp( config_file='config/config.yaml', custom_config={'debug': True}), } )
def load(self): from pywb.apps.frontendapp import FrontEndApp super(WaybackCli, self).load() return FrontEndApp(custom_config=self.extra_config)
def get_test_app(cls, config_file, custom_config=None): config_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), config_file) app = FrontEndApp(config_file=config_file, custom_config=custom_config) return app, webtest.TestApp(app)
from gevent.monkey import patch_all patch_all() from pywb.apps.frontendapp import FrontEndApp application = FrontEndApp()