コード例 #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'))
コード例 #2
0
ファイル: __init__.py プロジェクト: joshmarshall/haps.at
"""
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()
コード例 #3
0
 def test_routes_ordering(self):
     # our third handler's url route should be '/abc'
     self.assertTrue(route.get_routes()[2].reverse() == '/abc')
コード例 #4
0
 def test_num_routes(self):
     self.assertTrue(len(route.get_routes()) == 4)  # 2 routes + 2 redir
コード例 #5
0
ファイル: test_route.py プロジェクト: daqing15/torn
 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') )
コード例 #6
0
ファイル: test_route.py プロジェクト: daqing15/torn
 def test_routes_ordering(self):
     # our third handler's url route should be '/abc'
     self.assertTrue( route.get_routes()[2].reverse() == '/abc' )
コード例 #7
0
ファイル: test_route.py プロジェクト: daqing15/torn
 def test_num_routes(self):
     self.assertTrue( len(route.get_routes()) == 4 ) # 2 routes + 2 redir