def _create_app(cls, default_url, roots): views.load(roots=roots) if default_url is not None: views.add_default_view(default_url) mapping = ('(.+)', cls) web.config.debug = False return web.application(mapping)
def test_out_of_roots(self): View(foo) views.load(roots=['metaweb.views']) self.assertEqual(0, len(views._abs_pathes))
def test_prefix(self): view = View(foo) views.load(roots={'views_test': '/prefix'}) self.assertEqual(1, len(views._abs_pathes)) self.assertEqual(view, views._abs_pathes['/prefix/foo'])
def test_basic(self): view = View(foo) views.load(roots=['views_test']) self.assertEqual(1, len(views._abs_pathes)) self.assertEqual(view, views._abs_pathes['/foo'])
def wsgi(default_url=None, roots=('views',)): views.load(roots=roots) if default_url is not None: views.add_default_view(default_url) return WSGIApplication([('(.*)', GaeCoor)], debug=False)