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

Method test_port_mirror

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

Source from the content-addressed store, hash-verified

1301 self.assertIn('$Path="/"', h, "path not returned")
1302
1303 def test_port_mirror(self):
1304 pol = DefaultCookiePolicy(rfc2965=True)
1305
1306 c = CookieJar(pol)
1307 url = "http://foo.bar.com/"
1308 interact_2965(c, url, "spam=eggs; Version=1")
1309 h = interact_2965(c, url)
1310 self.assertNotIn("Port", h, "absent port returned with port present")
1311
1312 c = CookieJar(pol)
1313 url = "http://foo.bar.com/"
1314 interact_2965(c, url, "spam=eggs; Version=1; Port")
1315 h = interact_2965(c, url)
1316 self.assertRegex(h, r"\$Port([^=]|$)",
1317 "port with no value not returned with no value")
1318
1319 c = CookieJar(pol)
1320 url = "http://foo.bar.com/"
1321 interact_2965(c, url, 'spam=eggs; Version=1; Port="80"')
1322 h = interact_2965(c, url)
1323 self.assertIn('$Port="80"', h,
1324 "port with single value not returned with single value")
1325
1326 c = CookieJar(pol)
1327 url = "http://foo.bar.com/"
1328 interact_2965(c, url, 'spam=eggs; Version=1; Port="80,8080"')
1329 h = interact_2965(c, url)
1330 self.assertIn('$Port="80,8080"', h,
1331 "port with multiple values not returned with multiple "
1332 "values")
1333
1334 def test_no_return_comment(self):
1335 c = CookieJar(DefaultCookiePolicy(rfc2965=True))

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected