diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-02-03 10:57:52 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-02-03 10:57:52 (GMT) |
commit | 3bbfba841aadaf867f55da81b4608ae2d5e7f3e1 (patch) | |
tree | db75c132ff4e75a8b36707181a248a5993bbc307 /Lib | |
parent | 0e974b895febeb528de4d6daee3beee7ec5cb4f3 (diff) | |
download | cpython-3bbfba841aadaf867f55da81b4608ae2d5e7f3e1.zip cpython-3bbfba841aadaf867f55da81b4608ae2d5e7f3e1.tar.gz cpython-3bbfba841aadaf867f55da81b4608ae2d5e7f3e1.tar.bz2 |
r69209 caused the fp of HTTPResponse objects to be a io.BufferedReader instead of a socket.SocketIO. This moves the underlying socket.socket object from r.fp._sock to r.fp.raw._sock. Since _sock is an internal object, this should be ok. The change is for the testsuite only, to assert socket state.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_urllib2net.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index a18a4bb..ee0f67e 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -195,7 +195,7 @@ class TimeoutTest(unittest.TestCase): def test_http_basic(self): self.assertTrue(socket.getdefaulttimeout() is None) u = _urlopen_with_retry("http://www.python.org") - self.assertTrue(u.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.raw._sock.gettimeout() is None) def test_http_default_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -204,7 +204,7 @@ class TimeoutTest(unittest.TestCase): u = _urlopen_with_retry("http://www.python.org") finally: socket.setdefaulttimeout(None) - self.assertEqual(u.fp._sock.gettimeout(), 60) + self.assertEqual(u.fp.raw._sock.gettimeout(), 60) def test_http_no_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -213,11 +213,11 @@ class TimeoutTest(unittest.TestCase): u = _urlopen_with_retry("http://www.python.org", timeout=None) finally: socket.setdefaulttimeout(None) - self.assertTrue(u.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.raw._sock.gettimeout() is None) def test_http_timeout(self): u = _urlopen_with_retry("http://www.python.org", timeout=120) - self.assertEqual(u.fp._sock.gettimeout(), 120) + self.assertEqual(u.fp.raw._sock.gettimeout(), 120) FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/" |