def test_main(): """ sanity check for code that creates wsgi app """ from cheeseprism.wsgiapp import main globconf = dict() app = main(globconf, **{'cheeseprism.index_templates':'', 'cheeseprism.file_root': testdir, 'cheeseprism.data_json': 'data.json'}) assert app
def test_main(): """ sanity check for code that creates wsgi app """ from cheeseprism.wsgiapp import main globconf = dict() app = main( globconf, **{ 'cheeseprism.index_templates': '', 'cheeseprism.file_root': testdir, 'cheeseprism.data_json': 'data.json' }) assert app
def makeone(self, xtra=None, index_name='test-func-index', count=None): from cheeseprism.wsgiapp import main cp = ConfigParser(dict(here=self.base)) with open(resource_spec(self.devini)) as fp: cp.readfp(fp) defaults = dict((x, cp.get('DEFAULT', x)) for x in cp.defaults()) count = count is None and self.count or count self.idxpath = index_path = self.base / ("%s-%s" %(count, index_name)) settings = { 'cheeseprism.file_root': index_path, 'cheeseprism.data_json': 'data.json' } settings = xtra and dict(settings, **xtra) or settings app = main(defaults, **settings) self.executor = app.registry['cp.executor'] from webtest import TestApp return TestApp(app)
def makeone(self, xtra=None, index_name='test-func-index', count=None): from cheeseprism.wsgiapp import main cp = ConfigParser(dict(here=self.base)) with open(resource_spec(self.devini)) as fp: cp.readfp(fp) defaults = dict((x, cp.get('DEFAULT', x)) for x in cp.defaults()) count = count is None and self.count or count self.idxpath = index_path = self.base / ("%s-%s" % (count, index_name)) settings = { 'cheeseprism.file_root': index_path, 'cheeseprism.data_json': 'data.json' } settings = xtra and dict(settings, **xtra) or settings app = main(defaults, **settings) self.executor = app.registry['cp.executor'] from webtest import TestApp return TestApp(app)