mirror of
https://github.com/python/cpython.git
synced 2025-11-23 11:57:09 +00:00
Fix issue14826 - make urllib.request.Request quoted url consistent with URLOpener open method.
Patch contributed by Stephen Thorne.
This commit is contained in:
parent
5356af8c48
commit
01fe5fa8ea
3 changed files with 14 additions and 2 deletions
|
|
@ -1325,6 +1325,12 @@ class RequestTests(unittest.TestCase):
|
|||
req = Request("<URL:http://www.python.org>")
|
||||
self.assertEqual("www.python.org", req.get_host())
|
||||
|
||||
def test_quoted_full_url(self):
|
||||
Request = urllib2.Request
|
||||
request = Request('http://www.python.org/foo bar')
|
||||
self.assertEqual(request.get_full_url(),
|
||||
'http://www.python.org/foo%20bar')
|
||||
|
||||
def test_url_fragment(self):
|
||||
req = Request("http://www.python.org/?qs=query#fragment=true")
|
||||
self.assertEqual("/?qs=query", req.get_selector())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue