-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test case for dynamic rate limit added #66
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising this PR @sandeepkumar-one and apologies for the delay in responding to you, I was afk on holiday 😅
You unearthed a bug in the exempt
decorator which I fixed in #68. Thanks for that!
Just one comment on your tests, but otherwise happy to merge this. Nice to see the docs improvements :)
tests/test_fastapi_extension.py
Outdated
|
||
client = TestClient(app) | ||
|
||
for i in range(0, 10): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not really testing the exemption here, since you run 10 calls on an endpoint that would be limited to 10/minute anyway. I'd suggest lowering the test limit to 2/minute for instance, and run 10 calls to make sure you are indeed exempted.
Also, I fixed the bug you found in exempt
in #68. Feel free to test your code with that PR to make sure it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @laurentS, I have updated the test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The CI checks are not passing, it looks like you need to run black
on your changes, can you do that?
@sandeepkumar-one I've also added you to the repo as per #58 |
Test case for dynamic rate limiting added