Commit e324c573 authored by Senthil Kumaran's avatar Senthil Kumaran

using support.transient_internet helper method in the urllib2net test.

parent 59256329
...@@ -178,15 +178,19 @@ class OtherNetworkTests(unittest.TestCase): ...@@ -178,15 +178,19 @@ class OtherNetworkTests(unittest.TestCase):
# Some sites do not send Connection: close header. # Some sites do not send Connection: close header.
# Verify that those work properly. (#issue12576) # Verify that those work properly. (#issue12576)
URL = 'http://www.imdb.com' # mangles Connection:close
with support.transient_internet(URL):
try: try:
with urllib.request.urlopen('http://www.imdb.com') as res: with urllib.request.urlopen(URL) as res:
pass pass
except ValueError as e: except ValueError as e:
self.fail("urlopen failed for sites not sending Connection:close") self.fail("urlopen failed for site not sending \
Connection:close")
else: else:
self.assertTrue(res) self.assertTrue(res)
req = urllib.request.urlopen('http://www.imdb.com') req = urllib.request.urlopen(URL)
res = req.read() res = req.read()
self.assertTrue(res) self.assertTrue(res)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment