Пример #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)
Пример #2
0
 def test_out_of_roots(self):
     View(foo)
     views.load(roots=['metaweb.views'])
     self.assertEqual(0, len(views._abs_pathes))
Пример #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'])
Пример #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'])
Пример #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)