forked from retoor/devplacepy
Party Hardy
This commit is contained in:
@@ -156,18 +156,19 @@ def test_rate_limit_block_recorded(monkeypatch):
|
||||
# limiter re-enabled for itself - the same approach as test_ratelimit.py - and
|
||||
# asserts the block emits the security.rate_limit.block audit row.
|
||||
import devplacepy.main as m
|
||||
import devplacepy.middleware.state as st
|
||||
from starlette.testclient import TestClient
|
||||
|
||||
monkeypatch.setattr(m, "RATE_LIMIT_DISABLED", False)
|
||||
monkeypatch.setattr(st, "RATE_LIMIT_DISABLED", False)
|
||||
monkeypatch.setattr(
|
||||
m,
|
||||
st,
|
||||
"get_int_setting",
|
||||
lambda key, default: {
|
||||
"rate_limit_per_minute": 1,
|
||||
"rate_limit_window_seconds": 60,
|
||||
}.get(key, default),
|
||||
)
|
||||
m._rate_limit_store.clear()
|
||||
st._rate_limit_store.clear()
|
||||
ip = "203.0.113.77"
|
||||
client = TestClient(m.app)
|
||||
codes = [
|
||||
|
||||
Reference in New Issue
Block a user