Back to index

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

List of all members.

Public Member Functions

def __init__
def setUp
def tearDown
def clientSetUp
def clientTearDown
def serverExplicitReady
def clientRun

Public Attributes

 cli_conn
 serv_conn
 cli
 serv
 port
 setUp
 tearDown
 server_ready
 client_ready
 done
 queue
 client_thread

Detailed Description

Socket tests for client-server connection.

self.cli_conn is a client socket connected to the server.  The
setUp() method guarantees that it is connected to the server.

Definition at line 205 of file test_socket.py.


Constructor & Destructor Documentation

def test.test_socket.SocketConnectedTest.__init__ (   self,
  methodName = 'runTest' 
)

Reimplemented from test.test_socket.ThreadedTCPSocketTest.

Reimplemented in test.test_socket.BufferIOTest, test.test_socket.FileObjectClassTestCase, and test.test_socket.BasicTCPTest.

Definition at line 212 of file test_socket.py.

00212 
00213     def __init__(self, methodName='runTest'):
00214         ThreadedTCPSocketTest.__init__(self, methodName=methodName)

Here is the caller graph for this function:


Member Function Documentation

def test.test_socket.ThreadableTest.clientRun (   self,
  test_func 
) [inherited]

Definition at line 157 of file test_socket.py.

00157 
00158     def clientRun(self, test_func):
00159         self.server_ready.wait()
00160         self.client_ready.set()
00161         self.clientSetUp()
00162         if not hasattr(test_func, '__call__'):
00163             raise TypeError("test_func must be a callable function")
00164         try:
00165             test_func()
00166         except BaseException as e:
00167             self.queue.put(e)
00168         finally:
00169             self.clientTearDown()

Here is the call graph for this function:

Reimplemented from test.test_socket.ThreadedTCPSocketTest.

Reimplemented in test.test_socket.FileObjectClassTestCase.

Definition at line 228 of file test_socket.py.

00228 
00229     def clientSetUp(self):
00230         ThreadedTCPSocketTest.clientSetUp(self)
00231         self.cli.connect((HOST, self.port))
00232         self.serv_conn = self.cli

Reimplemented from test.test_socket.ThreadedTCPSocketTest.

Reimplemented in test.test_socket.FileObjectClassTestCase.

Definition at line 233 of file test_socket.py.

00233 
00234     def clientTearDown(self):
00235         self.serv_conn.close()
00236         self.serv_conn = None
00237         ThreadedTCPSocketTest.clientTearDown(self)

This method allows the server to explicitly indicate that
it wants the client thread to proceed. This is useful if the
server is about to execute a blocking routine that is
dependent upon the client thread during its setup routine.

Definition at line 123 of file test_socket.py.

00123 
00124     def serverExplicitReady(self):
00125         """This method allows the server to explicitly indicate that
00126         it wants the client thread to proceed. This is useful if the
00127         server is about to execute a blocking routine that is
00128         dependent upon the client thread during its setup routine."""
00129         self.server_ready.set()

Here is the caller graph for this function:

Reimplemented from test.test_socket.SocketTCPTest.

Reimplemented in test.test_socket.FileObjectClassTestCase.

Definition at line 215 of file test_socket.py.

00215 
00216     def setUp(self):
00217         ThreadedTCPSocketTest.setUp(self)
00218         # Indicate explicitly we're ready for the client thread to
00219         # proceed and then perform the blocking call to accept
00220         self.serverExplicitReady()
00221         conn, addr = self.serv.accept()
00222         self.cli_conn = conn

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from test.test_socket.SocketTCPTest.

Reimplemented in test.test_socket.FileObjectClassTestCase.

Definition at line 223 of file test_socket.py.

00223 
00224     def tearDown(self):
00225         self.cli_conn.close()
00226         self.cli_conn = None
00227         ThreadedTCPSocketTest.tearDown(self)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 184 of file test_socket.py.

Definition at line 221 of file test_socket.py.

Definition at line 132 of file test_socket.py.

Definition at line 141 of file test_socket.py.

Definition at line 133 of file test_socket.py.

Reimplemented in test.test_socket.NonBlockingTCPTests.

Definition at line 61 of file test_socket.py.

Definition at line 134 of file test_socket.py.

Reimplemented in test.test_socket.NonBlockingTCPTests.

Definition at line 60 of file test_socket.py.

Definition at line 231 of file test_socket.py.

Definition at line 131 of file test_socket.py.

Definition at line 120 of file test_socket.py.

Definition at line 121 of file test_socket.py.


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