MCPcopy
hub / github.com/psf/requests / test_hook_receives_request_arguments

Method test_hook_receives_request_arguments

tests/test_requests.py:1164–1172  ·  view source on GitHub ↗
(self, httpbin)

Source from the content-addressed store, hash-verified

1162 assert b"text/py-content-type" in r.request.body
1163
1164 def test_hook_receives_request_arguments(self, httpbin):
1165 def hook(resp, **kwargs):
1166 assert resp is not None
1167 assert kwargs != {}
1168
1169 s = requests.Session()
1170 r = requests.Request("GET", httpbin(), hooks={"response": hook})
1171 prep = s.prepare_request(r)
1172 s.send(prep)
1173
1174 def test_session_hooks_are_used_with_no_request_hooks(self, httpbin):
1175 def hook(*args, **kwargs):

Callers

nothing calls this directly

Calls 3

prepare_requestMethod · 0.95
sendMethod · 0.95
httpbinFunction · 0.85

Tested by

no test coverage detected