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'
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