Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_socket.UDPTimeoutTest Class Reference
Inheritance diagram for test.test_socket.UDPTimeoutTest:
Inheritance graph
[legend]
Collaboration diagram for test.test_socket.UDPTimeoutTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testUDPTimeout
def testTimeoutZero
def setUp
def tearDown

Public Attributes

 serv
 port

Detailed Description

Definition at line 1725 of file test_socket.py.


Member Function Documentation

def test.test_socket.SocketTCPTest.setUp (   self) [inherited]

Reimplemented in test.test_socket.FileObjectClassTestCase, and test.test_socket.SocketConnectedTest.

Definition at line 59 of file test_socket.py.

00059 
00060     def setUp(self):
00061         self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
00062         self.port = support.bind_port(self.serv)
00063         self.serv.listen(1)

Here is the caller graph for this function:

def test.test_socket.SocketTCPTest.tearDown (   self) [inherited]

Reimplemented in test.test_socket.FileObjectClassTestCase, and test.test_socket.SocketConnectedTest.

Definition at line 64 of file test_socket.py.

00064 
00065     def tearDown(self):
00066         self.serv.close()
00067         self.serv = None

Here is the caller graph for this function:

Definition at line 1734 of file test_socket.py.

01734 
01735     def testTimeoutZero(self):
01736         ok = False
01737         try:
01738             self.serv.settimeout(0.0)
01739             foo = self.serv.recv(1024)
01740         except socket.timeout:
01741             self.fail("caught timeout instead of error (UDP)")
01742         except socket.error:
01743             ok = True
01744         except:
01745             self.fail("caught unexpected exception (UDP)")
01746         if not ok:
01747             self.fail("recv() returned success when we did not expect it")

Here is the call graph for this function:

Definition at line 1727 of file test_socket.py.

01727 
01728     def testUDPTimeout(self):
01729         def raise_timeout(*args, **kwargs):
01730             self.serv.settimeout(1.0)
01731             self.serv.recv(1024)
01732         self.assertRaises(socket.timeout, raise_timeout,
01733                               "Error generating a timeout exception (UDP)")

Here is the call graph for this function:


Member Data Documentation

Reimplemented in test.test_socket.NonBlockingTCPTests.

Definition at line 61 of file test_socket.py.

Reimplemented in test.test_socket.NonBlockingTCPTests.

Definition at line 60 of file test_socket.py.


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