Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sandeepkumar-one
Copy link
Collaborator

Test case for dynamic rate limiting added

laurentS
laurentS previously approved these changes Oct 10, 2021
Copy link
Owner

@laurentS laurentS left a 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 :)


client = TestClient(app)

for i in range(0, 10):
Copy link
Owner

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.

Copy link
Collaborator Author

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.

Copy link
Owner

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?

@laurentS
Copy link
Owner

@sandeepkumar-one I've also added you to the repo as per #58

@laurentS laurentS linked an issue Oct 10, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change rate limit after the app has started
2 participants