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'))
""" 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()
def test_routes_ordering(self): # our third handler's url route should be '/abc' self.assertTrue(route.get_routes()[2].reverse() == '/abc')
def test_num_routes(self): self.assertTrue(len(route.get_routes()) == 4) # 2 routes + 2 redir
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') )
def test_routes_ordering(self): # our third handler's url route should be '/abc' self.assertTrue( route.get_routes()[2].reverse() == '/abc' )
def test_num_routes(self): self.assertTrue( len(route.get_routes()) == 4 ) # 2 routes + 2 redir