예제 #1
0
class TestStaticRouter(TestHTTPRouter):
    """Test to ensure that the static router sets up routes correctly"""
    route = StaticRouter("/here", requires=('love',), cache=True)
    route2 = StaticRouter(("/here", "/there"), api='api', cache={'no_store': True})

    def test_init(self):
        """Test to ensure the route instanciates as expected"""
        assert self.route.route['urls'] == ("/here", )
        assert self.route2.route['urls'] == ("/here", "/there")
        assert self.route2.route['api'] == 'api'
예제 #2
0
파일: test_route.py 프로젝트: wujm2007/hug
 def test_static(self):
     """Test to ensure you can dynamically create a static route attached to a hug API"""
     assert self.router.static().route == StaticRouter(api=api).route