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

Method test_parse_ns_headers

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

Source from the content-addressed store, hash-verified

1374 i = i + 1
1375
1376 def test_parse_ns_headers(self):
1377 # missing domain value (invalid cookie)
1378 self.assertEqual(
1379 parse_ns_headers(["foo=bar; path=/; domain"]),
1380 [[("foo", "bar"),
1381 ("path", "/"), ("domain", None), ("version", "0")]]
1382 )
1383 # invalid expires value
1384 self.assertEqual(
1385 parse_ns_headers(["foo=bar; expires=Foo Bar 12 33:22:11 2000"]),
1386 [[("foo", "bar"), ("expires", None), ("version", "0")]]
1387 )
1388 # missing cookie value (valid cookie)
1389 self.assertEqual(
1390 parse_ns_headers(["foo"]),
1391 [[("foo", None), ("version", "0")]]
1392 )
1393 # missing cookie values for parsed attributes
1394 self.assertEqual(
1395 parse_ns_headers(['foo=bar; expires']),
1396 [[('foo', 'bar'), ('expires', None), ('version', '0')]])
1397 self.assertEqual(
1398 parse_ns_headers(['foo=bar; version']),
1399 [[('foo', 'bar'), ('version', None)]])
1400 # shouldn't add version if header is empty
1401 self.assertEqual(parse_ns_headers([""]), [])
1402
1403 def test_bad_cookie_header(self):
1404

Callers

nothing calls this directly

Calls 2

parse_ns_headersFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected