[Python-3000-checkins] r64377 - python/branches/py3k-urllib/Lib/test/test_urllib2_localnet.py
jeremy.hylton
python-3000-checkins at python.org
Wed Jun 18 16:29:57 CEST 2008
Author: jeremy.hylton
Date: Wed Jun 18 16:29:56 2008
New Revision: 64377
Log:
Fix corrupted info() test.
The server only has a single response, so a second urlopen() will
always fail. Revise this to be a simple test of a single info() call.
Modified:
python/branches/py3k-urllib/Lib/test/test_urllib2_localnet.py
Modified: python/branches/py3k-urllib/Lib/test/test_urllib2_localnet.py
==============================================================================
--- python/branches/py3k-urllib/Lib/test/test_urllib2_localnet.py (original)
+++ python/branches/py3k-urllib/Lib/test/test_urllib2_localnet.py Wed Jun 18 16:29:56 2008
@@ -420,12 +420,9 @@
def test_info(self):
handler = self.start_server()
- open_url = urllib.request.urlopen("http://localhost:%s" % handler.port)
- info_obj = open_url.info()
- self.assertEqual(info_obj.getsubtype(), "plain")
-
try:
- open_url = urllib.request.urlopen("http://localhost:%s" % handler.port)
+ open_url = urllib.request.urlopen(
+ "http://localhost:%s" % handler.port)
info_obj = open_url.info()
self.assert_(isinstance(info_obj, email.message.Message),
"object returned by 'info' is not an instance of "
More information about the Python-3000-checkins
mailing list