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

Method test_cookie_parameters

tests/test_requests.py:1272–1288  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1270 assert r.links["next"]["rel"] == "next"
1271
1272 def test_cookie_parameters(self):
1273 key = "some_cookie"
1274 value = "some_value"
1275 secure = True
1276 domain = "test.com"
1277 rest = {"HttpOnly": True}
1278
1279 jar = requests.cookies.RequestsCookieJar()
1280 jar.set(key, value, secure=secure, domain=domain, rest=rest)
1281
1282 assert len(jar) == 1
1283 assert "some_cookie" in jar
1284
1285 cookie = list(jar)[0]
1286 assert cookie.secure == secure
1287 assert cookie.domain == domain
1288 assert cookie._rest["HttpOnly"] == rest["HttpOnly"]
1289
1290 def test_cookie_as_dict_keeps_len(self):
1291 key = "some_cookie"

Callers

nothing calls this directly

Calls 1

setMethod · 0.95

Tested by

no test coverage detected