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