merge from 3.1

This commit is contained in:
Senthil Kumaran 2011-04-13 07:22:29 +08:00
commit b17abb1af9
4 changed files with 31 additions and 5 deletions

View file

@ -175,6 +175,16 @@ class urlopen_HttpTests(unittest.TestCase):
finally:
self.unfakehttp()
def test_url_fragment(self):
# Issue #11703: geturl() omits fragments in the original URL.
url = 'http://docs.python.org/library/urllib.html#OK'
self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello!")
try:
fp = urllib.request.urlopen(url)
self.assertEqual(fp.geturl(), url)
finally:
self.unfakehttp()
def test_willclose(self):
self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello!")
try: