summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_http_cookiejar.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_http_cookiejar.py')
-rw-r--r--Lib/test/test_http_cookiejar.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py
index 1c047b4..5a648e7 100644
--- a/Lib/test/test_http_cookiejar.py
+++ b/Lib/test/test_http_cookiejar.py
@@ -97,6 +97,7 @@ class DateTimeTests(TestCase):
class HeaderTests(TestCase):
+
def test_parse_ns_headers(self):
# quotes should be stripped
expected = [[('foo', 'bar'), ('expires', 2209069412), ('version', '0')]]
@@ -106,6 +107,16 @@ class HeaderTests(TestCase):
]:
self.assertEquals(parse_ns_headers([hdr]), expected)
+ def test_parse_ns_headers_version(self):
+
+ # quotes should be stripped
+ expected = [[('foo', 'bar'), ('version', '1')]]
+ for hdr in [
+ 'foo=bar; version="1"',
+ 'foo=bar; Version="1"',
+ ]:
+ self.assertEquals(parse_ns_headers([hdr]), expected)
+
def test_parse_ns_headers_special_names(self):
# names such as 'expires' are not special in first name=value pair
# of Set-Cookie: header
@@ -1020,6 +1031,8 @@ class CookieTests(TestCase):
["Set-Cookie2: a=foo; path=/; Version=1; domain"],
# bad max-age
["Set-Cookie: b=foo; max-age=oops"],
+ # bad version
+ ["Set-Cookie: b=foo; version=spam"],
]:
c = cookiejar_from_cookie_headers(headers)
# these bad cookies shouldn't be set