# What this PR does This PR refactors Throttling for public API and integrations API and allows to specify organization ratelimits. ## Which issue(s) this PR closes Related to [issue link here] <!-- *Note*: If you want the issue to be auto-closed once the PR is merged, change "Related to" to "Closes" in the line above. If you have more than one GitHub issue that this PR closes, be sure to preface each issue link with a [closing keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue). This ensures that the issue(s) are auto-closed once the PR has been merged. --> ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes.
25 lines
819 B
Python
25 lines
819 B
Python
from common.api_helpers.custom_rate_scoped_throttler import CustomRateUserThrottler
|
|
|
|
|
|
class TestCallThrottler(CustomRateUserThrottler):
|
|
"""
|
|
set a __test__ = False attribute in classes that pytest should ignore otherwise we end up getting the following:
|
|
PytestCollectionWarning: cannot collect test class 'TestCallThrottler' because it has a __init__ constructor
|
|
"""
|
|
|
|
__test__ = False
|
|
|
|
scope = "make_test_call"
|
|
rate = "5/m"
|
|
|
|
|
|
class TestPushThrottler(CustomRateUserThrottler):
|
|
"""
|
|
set a __test__ = False attribute in classes that pytest should ignore otherwise we end up getting the following:
|
|
PytestCollectionWarning: cannot collect test class 'TestPushThrottler' because it has a __init__ constructor
|
|
"""
|
|
|
|
__test__ = False
|
|
|
|
scope = "send_test_push"
|
|
rate = "10/m"
|