1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00
pywb/tests/server_mock.py
Ilya Kreymer e249f300e3 tests refactor! init pywb once per module, instead of once per test
refactor common init pattern to server_mock for now (can add fixtures also)
2015-10-14 20:34:46 -07:00

29 lines
691 B
Python

from pywb.webapp.pywb_init import create_wb_router
from pywb.framework.wsgi_wrappers import init_app
from webtest import TestApp
app = None
testapp = None
def make_app(config_file, pywb_router=create_wb_router):
app = init_app(pywb_router,
load_yaml=True,
config_file=config_file)
testapp = TestApp(app)
return app, testapp
def make_setup_module(config, pywb_router=create_wb_router):
def setup_module():
global app
global testapp
app, testapp = make_app(config, pywb_router)
return setup_module
class BaseIntegration(object):
def setup(self):
self.app = app
self.testapp = testapp