MCPcopy Index your code
hub / github.com/python/cpython / test_domain_mirror

Method test_domain_mirror

Lib/test/test_http_cookiejar.py:1265–1286  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1263 self.assertTrue(req.has_header("Cookie"))
1264
1265 def test_domain_mirror(self):
1266 pol = DefaultCookiePolicy(rfc2965=True)
1267
1268 c = CookieJar(pol)
1269 url = "http://foo.bar.com/"
1270 interact_2965(c, url, "spam=eggs; Version=1")
1271 h = interact_2965(c, url)
1272 self.assertNotIn("Domain", h,
1273 "absent domain returned with domain present")
1274
1275 c = CookieJar(pol)
1276 url = "http://foo.bar.com/"
1277 interact_2965(c, url, 'spam=eggs; Version=1; Domain=.bar.com')
1278 h = interact_2965(c, url)
1279 self.assertIn('$Domain=".bar.com"', h, "domain not returned")
1280
1281 c = CookieJar(pol)
1282 url = "http://foo.bar.com/"
1283 # note missing initial dot in Domain
1284 interact_2965(c, url, 'spam=eggs; Version=1; Domain=bar.com')
1285 h = interact_2965(c, url)
1286 self.assertIn('$Domain="bar.com"', h, "domain not returned")
1287
1288 def test_path_mirror(self):
1289 pol = DefaultCookiePolicy(rfc2965=True)

Callers

nothing calls this directly

Calls 5

DefaultCookiePolicyClass · 0.90
CookieJarClass · 0.90
interact_2965Function · 0.85
assertNotInMethod · 0.80
assertInMethod · 0.80

Tested by

no test coverage detected