Ejemplo n.º 1
0
 def test_routes_name(self):
     # our first handler's url route should be '/xyz'
     t = tornado.web.Application(route.get_routes(), {})
     self.assertTrue(t.reverse_url('abc'))
     self.assertTrue(t.reverse_url('other'))
Ejemplo n.º 2
0
"""
This file sets up what routes are used by the server. You
should import any modules in this directory that you want
to have accessible to the application, and then call the
route.get_routes() method as shown below.
"""

# Import all the views you want to utilize
import haps.views.index
import haps.views.feeds.flickr
import haps.views.feeds.twitter
import haps.views.feeds.lastfm
import haps.views.feeds.yelp

# After all views are imported...
from torn.route import route
routes = route.get_routes()
Ejemplo n.º 3
0
 def test_routes_ordering(self):
     # our third handler's url route should be '/abc'
     self.assertTrue(route.get_routes()[2].reverse() == '/abc')
Ejemplo n.º 4
0
 def test_num_routes(self):
     self.assertTrue(len(route.get_routes()) == 4)  # 2 routes + 2 redir
Ejemplo n.º 5
0
 def test_routes_name(self):
     # our first handler's url route should be '/xyz'
     t = tornado.web.Application(route.get_routes(), {})
     self.assertTrue( t.reverse_url('abc') )
     self.assertTrue( t.reverse_url('other') )
Ejemplo n.º 6
0
 def test_routes_ordering(self):
     # our third handler's url route should be '/abc'
     self.assertTrue( route.get_routes()[2].reverse() == '/abc' )
Ejemplo n.º 7
0
 def test_num_routes(self):
     self.assertTrue( len(route.get_routes()) == 4 ) # 2 routes + 2 redir