summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2net.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_urllib2net.py')
-rw-r--r--Lib/test/test_urllib2net.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index 76572b0..56e952d 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -161,6 +161,17 @@ class OtherNetworkTests(unittest.TestCase):
self.assertEqual(res.geturl(),
"http://docs.python.org/glossary.html")
+ def test_fileno(self):
+ req = urllib2.Request("http://www.python.org")
+ opener = urllib2.build_opener()
+ res = opener.open(req)
+ try:
+ res.fileno()
+ except AttributeError:
+ self.fail("HTTPResponse object should return a valid fileno")
+ finally:
+ res.close()
+
def _test_urls(self, urls, handlers, retry=True):
import time
import logging