Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_urllib2net.TimeoutTest Class Reference
Collaboration diagram for test.test_urllib2net.TimeoutTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_http_basic
def test_http_default_timeout
def test_http_no_timeout
def test_http_timeout
def test_ftp_basic
def test_ftp_default_timeout
def test_ftp_no_timeout
def test_ftp_timeout

Static Public Attributes

string FTP_HOST = "ftp://ftp.mirror.nl/pub/gnu/"

Detailed Description

Definition at line 252 of file test_urllib2net.py.


Member Function Documentation

Definition at line 294 of file test_urllib2net.py.

00294 
00295     def test_ftp_basic(self):
00296         self.assertTrue(socket.getdefaulttimeout() is None)
00297         with support.transient_internet(self.FTP_HOST, timeout=None):
00298             u = _urlopen_with_retry(self.FTP_HOST)
00299             self.addCleanup(u.close)
00300             self.assertTrue(u.fp.fp.raw._sock.gettimeout() is None)

Here is the call graph for this function:

Definition at line 301 of file test_urllib2net.py.

00301 
00302     def test_ftp_default_timeout(self):
00303         self.assertTrue(socket.getdefaulttimeout() is None)
00304         with support.transient_internet(self.FTP_HOST):
00305             socket.setdefaulttimeout(60)
00306             try:
00307                 u = _urlopen_with_retry(self.FTP_HOST)
00308                 self.addCleanup(u.close)
00309             finally:
00310                 socket.setdefaulttimeout(None)
00311             self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)

Here is the call graph for this function:

Definition at line 312 of file test_urllib2net.py.

00312 
00313     def test_ftp_no_timeout(self):
00314         self.assertTrue(socket.getdefaulttimeout() is None)
00315         with support.transient_internet(self.FTP_HOST):
00316             socket.setdefaulttimeout(60)
00317             try:
00318                 u = _urlopen_with_retry(self.FTP_HOST, timeout=None)
00319                 self.addCleanup(u.close)
00320             finally:
00321                 socket.setdefaulttimeout(None)
00322             self.assertTrue(u.fp.fp.raw._sock.gettimeout() is None)

Here is the call graph for this function:

Definition at line 323 of file test_urllib2net.py.

00323 
00324     def test_ftp_timeout(self):
00325         with support.transient_internet(self.FTP_HOST):
00326             u = _urlopen_with_retry(self.FTP_HOST, timeout=60)
00327             self.addCleanup(u.close)
00328             self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)
00329 
00330 
@unittest.skipUnless(ssl, "requires SSL support")

Here is the call graph for this function:

Definition at line 253 of file test_urllib2net.py.

00253 
00254     def test_http_basic(self):
00255         self.assertTrue(socket.getdefaulttimeout() is None)
00256         url = "http://www.python.org"
00257         with support.transient_internet(url, timeout=None):
00258             u = _urlopen_with_retry(url)
00259             self.addCleanup(u.close)
00260             self.assertTrue(u.fp.raw._sock.gettimeout() is None)

Here is the call graph for this function:

Definition at line 261 of file test_urllib2net.py.

00261 
00262     def test_http_default_timeout(self):
00263         self.assertTrue(socket.getdefaulttimeout() is None)
00264         url = "http://www.python.org"
00265         with support.transient_internet(url):
00266             socket.setdefaulttimeout(60)
00267             try:
00268                 u = _urlopen_with_retry(url)
00269                 self.addCleanup(u.close)
00270             finally:
00271                 socket.setdefaulttimeout(None)
00272             self.assertEqual(u.fp.raw._sock.gettimeout(), 60)

Here is the call graph for this function:

Definition at line 273 of file test_urllib2net.py.

00273 
00274     def test_http_no_timeout(self):
00275         self.assertTrue(socket.getdefaulttimeout() is None)
00276         url = "http://www.python.org"
00277         with support.transient_internet(url):
00278             socket.setdefaulttimeout(60)
00279             try:
00280                 u = _urlopen_with_retry(url, timeout=None)
00281                 self.addCleanup(u.close)
00282             finally:
00283                 socket.setdefaulttimeout(None)
00284             self.assertTrue(u.fp.raw._sock.gettimeout() is None)

Here is the call graph for this function:

Definition at line 285 of file test_urllib2net.py.

00285 
00286     def test_http_timeout(self):
00287         url = "http://www.python.org"
00288         with support.transient_internet(url):
00289             u = _urlopen_with_retry(url, timeout=120)
00290             self.addCleanup(u.close)
00291             self.assertEqual(u.fp.raw._sock.gettimeout(), 120)

Here is the call graph for this function:


Member Data Documentation

string test.test_urllib2net.TimeoutTest.FTP_HOST = "ftp://ftp.mirror.nl/pub/gnu/" [static]

Definition at line 292 of file test_urllib2net.py.


The documentation for this class was generated from the following file: