quick commit
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 6m9s
CI/CD Pipeline / Security Scanning (push) Successful in 26s
CI/CD Pipeline / Tests (3.11) (push) Failing after 5m24s
CI/CD Pipeline / Tests (3.12) (push) Failing after 5m23s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
CI/CD Pipeline / Deploy to Staging (push) Has been skipped
CI/CD Pipeline / Deploy to Production (push) Has been skipped
CI/CD Pipeline / Notification (push) Successful in 1s
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 6m9s
CI/CD Pipeline / Security Scanning (push) Successful in 26s
CI/CD Pipeline / Tests (3.11) (push) Failing after 5m24s
CI/CD Pipeline / Tests (3.12) (push) Failing after 5m23s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
CI/CD Pipeline / Deploy to Staging (push) Has been skipped
CI/CD Pipeline / Deploy to Production (push) Has been skipped
CI/CD Pipeline / Notification (push) Successful in 1s
This commit is contained in:
@@ -112,6 +112,18 @@ class TestRateLimiter:
|
||||
assert result.is_limited is False
|
||||
assert result.remaining == 999
|
||||
|
||||
def test_acquire_command_scopes_per_command(self, limiter: RateLimiter) -> None:
|
||||
"""Test per-command rate limits are independent."""
|
||||
for _ in range(5):
|
||||
result = limiter.acquire_command("config", user_id=1, guild_id=1)
|
||||
assert result.is_limited is False
|
||||
|
||||
limited = limiter.acquire_command("config", user_id=1, guild_id=1)
|
||||
assert limited.is_limited is True
|
||||
|
||||
other = limiter.acquire_command("other", user_id=1, guild_id=1)
|
||||
assert other.is_limited is False
|
||||
|
||||
def test_guild_scope(self, limiter: RateLimiter) -> None:
|
||||
"""Test guild-scoped rate limiting."""
|
||||
limiter.configure(
|
||||
|
||||
Reference in New Issue
Block a user