Skip to content

Commit 32a1166

Browse files
committed
fix falcon
1 parent d2beba4 commit 32a1166

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/integrations/falcon/test_falcon.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import falcon
66
import falcon.testing
77
import sentry_sdk
8+
from sentry_sdk.consts import DEFAULT_MAX_VALUE_LENGTH
89
from sentry_sdk.integrations.falcon import FalconIntegration
910
from sentry_sdk.integrations.logging import LoggingIntegration
1011
from sentry_sdk.utils import parse_version
@@ -207,9 +208,9 @@ def on_get(self, req, resp):
207208

208209

209210
def test_falcon_large_json_request(sentry_init, capture_events):
210-
sentry_init(integrations=[FalconIntegration()])
211+
sentry_init(integrations=[FalconIntegration()], max_request_body_size="always")
211212

212-
data = {"foo": {"bar": "a" * 2000}}
213+
data = {"foo": {"bar": "a" * (DEFAULT_MAX_VALUE_LENGTH + 10)}}
213214

214215
class Resource:
215216
def on_post(self, req, resp):
@@ -228,9 +229,14 @@ def on_post(self, req, resp):
228229

229230
(event,) = events
230231
assert event["_meta"]["request"]["data"]["foo"]["bar"] == {
231-
"": {"len": 2000, "rem": [["!limit", "x", 1021, 1024]]}
232+
"": {
233+
"len": DEFAULT_MAX_VALUE_LENGTH + 10,
234+
"rem": [
235+
["!limit", "x", DEFAULT_MAX_VALUE_LENGTH - 3, DEFAULT_MAX_VALUE_LENGTH]
236+
],
237+
}
232238
}
233-
assert len(event["request"]["data"]["foo"]["bar"]) == 1024
239+
assert len(event["request"]["data"]["foo"]["bar"]) == DEFAULT_MAX_VALUE_LENGTH
234240

235241

236242
@pytest.mark.parametrize("data", [{}, []], ids=["empty-dict", "empty-list"])

0 commit comments

Comments
 (0)