Commit Graph

21 Commits

Author SHA1 Message Date
thentgesMindee
3ae7154271 chg: minor change in testing 2022-11-08 17:58:11 +01:00
thentgesMindee
7f87a26201 chg: update tests to reflect behavior explained in docs 2022-11-07 18:39:01 +01:00
thentgesMindee
2ba9ed0630 fix: 🎨 apply black on tests files 2022-11-07 17:47:56 +01:00
thentgesMindee
b0d7bb03b7 chg: 🔀 update tests after rebase 2022-11-07 17:37:35 +01:00
thentgesMindee
17a514faef new: add key_style parameter to choose between endpoint or url 2022-11-07 17:35:29 +01:00
thentgesMindee
bc69ebc8e5 chg: 🔀 update tests after rebase 2022-11-07 16:40:14 +01:00
thentgesMindee
bd9a1ecc55 chg: parametrize tests to use both HTTP and ASGI middlewares 2022-11-07 16:40:14 +01:00
Joris Hartog
5bb0edbd01 Add endpoints to cost/hit tests 2022-08-29 22:08:07 +02:00
Joris Hartog
c21ba98dcb Add support for custom cost per hit
This commit adds a `cost` keyword to the `limit` and `shared_limit`
decorators which sets the cost of a hit.

This uses the `cost` keyword that was introduced in `limits` version
2.3.0, so this commit also updates the `limits` dependency from `^1.5`
to `^2.3`.

Closes #94, #106
2022-08-26 23:40:00 +02:00
Marat Sarbasov
59d2cdd9de Add test_dynamic_limit_provider_depending_on_key 2022-01-16 04:38:08 +03:00
Laurent Savaete
e5cd5a6899 Merge pull request #60 from twcurrie/twcurrie/multiple-decorators-with-headers
Resolving bug with handling the Retry-After header.
2021-08-28 15:13:33 +01:00
Trevor Currie
9f164179bc Linting. 2021-08-24 09:02:44 -07:00
Trevor Currie
9bd22a1f00 Resolving bug with handling the Retry-After header. 2021-08-24 08:55:35 -07:00
Trevor Currie
21652645ef Resolving bug of unregistered endpoints in the disabled state. 2021-04-05 15:38:18 -07:00
Laurent Savaete
458def2a72 Fix #35 Disable the limiter if enabled==False 2021-02-05 00:51:00 +00:00
Guillaume Gardey
b6fa460254 Fix formatting 2020-12-23 10:04:52 +00:00
Guillaume Gardey
755bf44e12 Fix copy/paste issue in test 2020-12-23 09:48:50 +00:00
Guillaume Gardey
acde458c45 fix: Address issue with decorator
The value returned by an endpoint may not be an instance or subclass
of `Response`, in this case FastAPI builds the actual Response
at an upper level in the middleware stack.
This patch allows the decorator to inspect the endpoint to retrieve the
associated `Response` to allow headers to be injected.
2020-12-23 09:48:50 +00:00
Laurent Savaete
b82536a669 Fix black and mypy errors 2020-09-28 00:53:41 +01:00
Thomas LEVEIL
a66a728e50 TESTS : cover cases of missing request: Request parameter or misuse 2020-09-27 20:20:16 +02:00
Laurent Savaete
9880ff7625 First version 2020-02-21 13:51:35 +00:00