Commit f054aeb2 authored by Neal Norwitz's avatar Neal Norwitz

Try to fix another networking test. The problem is that if hosts have

a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to.  Hopefully this doesn't break different bots.

Also add more info to failure message to aid debugging test failure.
parent a29fc29f
...@@ -160,8 +160,8 @@ class OtherNetworkTests(unittest.TestCase): ...@@ -160,8 +160,8 @@ class OtherNetworkTests(unittest.TestCase):
"urllib2$") "urllib2$")
urls = [ urls = [
# Thanks to Fred for finding these! # Thanks to Fred for finding these!
'gopher://gopher.lib.ncsu.edu/11/library/stacks/Alex', 'gopher://gopher.lib.ncsu.edu./11/library/stacks/Alex',
'gopher://gopher.vt.edu:10010/10/33', 'gopher://gopher.vt.edu.:10010/10/33',
] ]
self._test_urls(urls, self._extra_handlers()) self._test_urls(urls, self._extra_handlers())
...@@ -239,7 +239,9 @@ class OtherNetworkTests(unittest.TestCase): ...@@ -239,7 +239,9 @@ class OtherNetworkTests(unittest.TestCase):
except (IOError, socket.error, OSError), err: except (IOError, socket.error, OSError), err:
debug(err) debug(err)
if expected_err: if expected_err:
self.assert_(isinstance(err, expected_err)) msg = ("Didn't get expected error(s) %s for %s %s, got %s" %
(expected_err, url, req, err))
self.assert_(isinstance(err, expected_err), msg)
else: else:
buf = f.read() buf = f.read()
f.close() f.close()
...@@ -259,7 +261,6 @@ class OtherNetworkTests(unittest.TestCase): ...@@ -259,7 +261,6 @@ class OtherNetworkTests(unittest.TestCase):
return handlers return handlers
def test_main(): def test_main():
test_support.requires("network") test_support.requires("network")
test_support.run_unittest(URLTimeoutTest, urlopenNetworkTests, test_support.run_unittest(URLTimeoutTest, urlopenNetworkTests,
......
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