MCPcopy
hub / github.com/encode/httpx / test_multiple_set_cookie

Function test_multiple_set_cookie

tests/models/test_cookies.py:55–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54
55def test_multiple_set_cookie():
56 jar = http.cookiejar.CookieJar()
57 headers = [
58 (
59 b"Set-Cookie",
60 b"1P_JAR=2020-08-09-18; expires=Tue, 08-Sep-2099 18:33:35 GMT; "
61 b"path=/; domain=.example.org; Secure",
62 ),
63 (
64 b"Set-Cookie",
65 b"NID=204=KWdXOuypc86YvRfBSiWoW1dEXfSl_5qI7sxZY4umlk4J35yNTeNEkw15"
66 b"MRaujK6uYCwkrtjihTTXZPp285z_xDOUzrdHt4dj0Z5C0VOpbvdLwRdHatHAzQs7"
67 b"7TsaiWY78a3qU9r7KP_RbSLvLl2hlhnWFR2Hp5nWKPsAcOhQgSg; expires=Mon, "
68 b"08-Feb-2099 18:33:35 GMT; path=/; domain=.example.org; HttpOnly",
69 ),
70 ]
71 request = httpx.Request("GET", "https://www.example.org")
72 response = httpx.Response(200, request=request, headers=headers)
73
74 cookies = httpx.Cookies(jar)
75 cookies.extract_cookies(response)
76
77 assert len(cookies) == 2
78
79
80def test_cookies_can_be_a_list_of_tuples():

Callers

nothing calls this directly

Calls 1

extract_cookiesMethod · 0.95

Tested by

no test coverage detected