mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Bug #735248: Fix urllib2.parse_http_list.
This commit is contained in:
parent
256372c88c
commit
e1b13d2019
2 changed files with 43 additions and 38 deletions
|
@ -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 = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue