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

Method test_generic_cookiejar_works

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

Source from the content-addressed store, hash-verified

429 assert not s.cookies
430
431 def test_generic_cookiejar_works(self, httpbin):
432 cj = cookielib.CookieJar()
433 cookiejar_from_dict({"foo": "bar"}, cj)
434 s = requests.session()
435 s.cookies = cj
436 r = s.get(httpbin("cookies"))
437 # Make sure the cookie was sent
438 assert r.json()["cookies"]["foo"] == "bar"
439 # Make sure the session cj is still the custom one
440 assert s.cookies is cj
441
442 def test_param_cookiejar_works(self, httpbin):
443 cj = cookielib.CookieJar()

Callers

nothing calls this directly

Calls 4

cookiejar_from_dictFunction · 0.90
httpbinFunction · 0.85
jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected