Skip to content

Commit 48ddc4f

Browse files
committed
fix test
1 parent 1a38de3 commit 48ddc4f

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

tests/integrations/wsgi/test_wsgi.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -334,25 +334,21 @@ def app(environ, start_response):
334334
start_response("200 OK", [])
335335
return ["Go get the ball! Good dog!"]
336336

337-
traces_sampler = mock.Mock(return_value=True)
337+
def traces_sampler(sampling_context):
338+
assert sampling_context["http.request.method"] == "GET"
339+
assert sampling_context["url.path"] == "/dogs/are/great/"
340+
assert sampling_context["url.query"] == "cats=too"
341+
assert sampling_context["url.scheme"] == "http"
342+
assert (
343+
sampling_context["url.full"] == "http://localhost/dogs/are/great/?cats=too"
344+
)
345+
return True
346+
338347
sentry_init(send_default_pii=True, traces_sampler=traces_sampler)
339348
app = SentryWsgiMiddleware(app)
340349
client = Client(app)
341350

342-
client.get("/dogs/are/great/")
343-
344-
traces_sampler.assert_any_call(
345-
DictionaryContaining(
346-
{
347-
"wsgi_environ": DictionaryContaining(
348-
{
349-
"PATH_INFO": "/dogs/are/great/",
350-
"REQUEST_METHOD": "GET",
351-
},
352-
),
353-
}
354-
)
355-
)
351+
client.get("/dogs/are/great/?cats=too")
356352

357353

358354
def test_session_mode_defaults_to_request_mode_in_wsgi_handler(

0 commit comments

Comments
 (0)