diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-08 11:43:45 +0000 |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-08 11:43:45 +0000 |
commit | b4ec7ee486c571694ece406d38259054983b091b (patch) | |
tree | b544684a4f606201a8d53aa60a63c38ae32027f4 /Lib/test/test_urllib2.py | |
parent | 431774f32a22a4bdfc5a239709bcba3e8d7045e9 (diff) | |
download | cpython-git-b4ec7ee486c571694ece406d38259054983b091b.tar.gz |
Merged revisions 83818 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83818 | senthil.kumaran | 2010-08-08 16:57:53 +0530 (Sun, 08 Aug 2010) | 4 lines
Fix Issue8280 - urllib2's Request method will remove fragements in the url.
This is how it should work,wget and curl work like this way too. Old behavior was wrong.
........
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r-- | Lib/test/test_urllib2.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 23631f657f..87030819c5 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1237,6 +1237,16 @@ class RequestTests(unittest.TestCase): self.assertEqual("www.python.org", self.get.get_origin_req_host()) self.assertEqual("www.perl.org", self.get.get_host()) + def test_wrapped_url(self): + req = Request("<URL:http://www.python.org>") + self.assertEqual("www.python.org", req.get_host()) + + def test_urlwith_fragment(self): + req = Request("http://www.python.org/?qs=query#fragment=true") + self.assertEqual("/?qs=query", req.get_selector()) + req = Request("http://www.python.org/#fun=true") + self.assertEqual("/", req.get_selector()) + def test_main(verbose=None): from test import test_urllib2 |