Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Set up the route(s) corresponding to the limit.  This controls
which limits are checked against the request.

:param mapper: The routes.Mapper object to add the route to.

src/t/u/turnstile-HEAD/tests/unit/test_limits.py   turnstile(Download)
    def test_route_basic(self, mock_route):
        mapper = mock.Mock()
        limit = limits.Limit('db', uri='uri', value=10, unit=1)
        limit._route(mapper)
 
    def test_route_verbs(self, mock_route):
        mapper = mock.Mock()
        limit = limits.Limit('db', uri='uri', value=10, unit=1,
                             verbs=['get', 'post'])
        limit._route(mapper)
    def test_route_requirements(self, mock_route):
        mapper = mock.Mock()
        limit = limits.Limit('db', uri='uri', value=10, unit=1,
                             requirements=dict(foo=r'\..*', bar=r'.\.*'))
        limit._route(mapper)