summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-08-24 22:20:32 (GMT)
committerGeorg Brandl <georg@python.org>2005-08-24 22:20:32 (GMT)
commite1b13d20199f79ffd3407bbb14cc09b1b8fd70d2 (patch)
tree8df7a1a1a316d551d0cb7f5cc36312f957ce9c94 /Lib/test/test_urllib2.py
parent256372c88cbd203e92950129c228c1df82d65f3e (diff)
downloadcpython-e1b13d20199f79ffd3407bbb14cc09b1b8fd70d2.zip
cpython-e1b13d20199f79ffd3407bbb14cc09b1b8fd70d2.tar.gz
cpython-e1b13d20199f79ffd3407bbb14cc09b1b8fd70d2.tar.bz2
Bug #735248: Fix urllib2.parse_http_list.
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r--Lib/test/test_urllib2.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index b07fd36..8248967 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -45,6 +45,14 @@ class TrivialTests(unittest.TestCase):
# test the new-in-2.5 httpresponses dictionary
self.assertEquals(urllib2.httpresponses[404], "Not Found")
+ def test_parse_http_list(self):
+ tests = [('a,b,c', ['a', 'b', 'c']),
+ ('path"o,l"og"i"cal, example', ['path"o,l"og"i"cal', 'example']),
+ ('a, b, "c", "d", "e,f", g, h', ['a', 'b', '"c"', '"d"', '"e,f"', 'g', 'h']),
+ ('a="b\\"c", d="e\\,f", g="h\\\\i"', ['a="b"c"', 'd="e,f"', 'g="h\\i"'])]
+ for string, list in tests:
+ self.assertEquals(urllib2.parse_http_list(string), list)
+
class MockOpener:
addheaders = []