コード例 #1
0
 def test_get_module_routes(self):
     """Tests routes.get_module_routes"""
     assert sorted(routes.get_module_routes("cars.api")) == sorted([
         ("/api/cars/?", cars.api.MakeListHandler),
         ("/api/cars/(?P<make>[a-zA-Z0-9_]+)/(?P<model>[a-zA-Z0-9_]+)/?$",
          cars.api.ModelHandler),
         ("/api/cars/(?P<make>[a-zA-Z0-9_]+)/(?P<model>[a-zA-Z0-9_]+)/"
          "(?P<year>[a-zA-Z0-9_]+)/?$", cars.api.YearHandler),
         ("/api/cars/(?P<make>[a-zA-Z0-9_]+)/?$", cars.api.MakeHandler),
     ])
コード例 #2
0
 def test_get_module_routes(self):
     """Tests routes.get_module_routes"""
     assert sorted(routes.get_module_routes(
         "cars.api")) == sorted([
         ("/api/cars/?", cars.api.MakeListHandler),
         ("/api/cars/(?P<make>[a-zA-Z0-9_]+)/(?P<model>[a-zA-Z0-9_]+)/?$",
          cars.api.ModelHandler),
         ("/api/cars/(?P<make>[a-zA-Z0-9_]+)/(?P<model>[a-zA-Z0-9_]+)/"
          "(?P<year>[a-zA-Z0-9_]+)/?$", cars.api.YearHandler),
         ("/api/cars/(?P<make>[a-zA-Z0-9_]+)/?$", cars.api.MakeHandler),
     ])
コード例 #3
0
 def test_get_module_routes(self):
     """Tests routes.get_module_routes"""
     assert sorted(routes.get_module_routes(
         'helloworld.api')) == sorted([
         ("/api/helloworld", helloworld.api.HelloWorldHandler),
         ("/api/asynchelloworld", helloworld.api.AsyncHelloWorld),
         ("/api/postit", helloworld.api.PostIt),
         ("/api/greeting/(?P<fname>[a-zA-Z0-9_]+)/(?P<lname>[a-zA-Z0-9_]+)/?$",
          helloworld.api.Greeting),
         ("/api/freewilled", helloworld.api.FreeWilledHandler)
     ])