test: remove duplicate rate limiter tests from test_security_fixes
These two tests were exact subsets of the dedicated test_rate_limit.py suite. Consolidating to a single file avoids maintenance drift. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Abhimanyu Saharan
parent
cc50877131
commit
fcbde9b0e1
@@ -492,29 +492,6 @@ class TestWebhookPayloadSizeLimit:
|
||||
await engine.dispose()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Task 11: Rate limiting
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class TestRateLimiting:
|
||||
"""Tests for the rate limiter module."""
|
||||
|
||||
def test_rate_limiter_blocks_after_threshold(self) -> None:
|
||||
limiter = InMemoryRateLimiter(max_requests=3, window_seconds=60.0)
|
||||
assert limiter.is_allowed("ip-1") is True
|
||||
assert limiter.is_allowed("ip-1") is True
|
||||
assert limiter.is_allowed("ip-1") is True
|
||||
assert limiter.is_allowed("ip-1") is False
|
||||
|
||||
def test_rate_limiter_independent_keys(self) -> None:
|
||||
limiter = InMemoryRateLimiter(max_requests=1, window_seconds=60.0)
|
||||
assert limiter.is_allowed("ip-1") is True
|
||||
assert limiter.is_allowed("ip-1") is False
|
||||
assert limiter.is_allowed("ip-2") is True
|
||||
assert limiter.is_allowed("ip-2") is False
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Task 12: Gateway token redaction
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user