Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 def test_out_of_roots(self):
     View(foo)
     views.load(roots=['metaweb.views'])
     self.assertEqual(0, len(views._abs_pathes))
Ejemplo n.º 3
0
 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'])
Ejemplo n.º 4
0
 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'])
Ejemplo n.º 5
0
 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)