diff options
| author | Senthil Kumaran <senthil@uthcode.com> | 2012-07-08 00:37:53 (GMT) |
|---|---|---|
| committer | Senthil Kumaran <senthil@uthcode.com> | 2012-07-08 00:37:53 (GMT) |
| commit | 01fe5fa8ea52ba49063d20a5044fb84efdbabe48 (patch) | |
| tree | fcca35aacbafd582deff4c5c019abb3c931d3ff0 /Lib/test/test_urllib2.py | |
| parent | 5356af8c489d6760f4ad7d88f1178d3820d09999 (diff) | |
| download | cpython-01fe5fa8ea52ba49063d20a5044fb84efdbabe48.zip cpython-01fe5fa8ea52ba49063d20a5044fb84efdbabe48.tar.gz cpython-01fe5fa8ea52ba49063d20a5044fb84efdbabe48.tar.bz2 | |
Fix issue14826 - make urllib.request.Request quoted url consistent with URLOpener open method.
Patch contributed by Stephen Thorne.
Diffstat (limited to 'Lib/test/test_urllib2.py')
| -rw-r--r-- | Lib/test/test_urllib2.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index fc76a6c..dd5ff8d8 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -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()) |
