Back to index

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

List of all members.

Public Member Functions

def __init__
def testRecvIntoArray
def testRecvIntoBytearray
def testRecvIntoMemoryview
def testRecvFromIntoArray
def testRecvFromIntoBytearray
def testRecvFromIntoMemoryview
def setUp
def tearDown
def clientSetUp
def clientTearDown
def serverExplicitReady
def clientRun

Public Attributes

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

Private Member Functions

def _testRecvIntoArray
def _testRecvFromIntoArray

Static Private Attributes

 _testRecvIntoBytearray = _testRecvIntoArray
 _testRecvIntoMemoryview = _testRecvIntoArray
 _testRecvFromIntoBytearray = _testRecvFromIntoArray
 _testRecvFromIntoMemoryview = _testRecvFromIntoArray

Detailed Description

Test the buffer versions of socket.recv() and socket.send().

Definition at line 1784 of file test_socket.py.


Constructor & Destructor Documentation

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

Reimplemented from test.test_socket.SocketConnectedTest.

Definition at line 1788 of file test_socket.py.

01788 
01789     def __init__(self, methodName='runTest'):
01790         SocketConnectedTest.__init__(self, methodName=methodName)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 1827 of file test_socket.py.

01827 
01828     def _testRecvFromIntoArray(self):
01829         buf = bytes(MSG)
01830         self.serv_conn.send(buf)

Definition at line 1798 of file test_socket.py.

01798 
01799     def _testRecvIntoArray(self):
01800         buf = bytes(MSG)
01801         self.serv_conn.send(buf)

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:

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

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:

Definition at line 1820 of file test_socket.py.

01820 
01821     def testRecvFromIntoArray(self):
01822         buf = bytearray(1024)
01823         nbytes, addr = self.cli_conn.recvfrom_into(buf)
01824         self.assertEqual(nbytes, len(MSG))
01825         msg = buf[:len(MSG)]
01826         self.assertEqual(msg, MSG)

Here is the call graph for this function:

Definition at line 1831 of file test_socket.py.

01831 
01832     def testRecvFromIntoBytearray(self):
01833         buf = bytearray(1024)
01834         nbytes, addr = self.cli_conn.recvfrom_into(buf)
01835         self.assertEqual(nbytes, len(MSG))
01836         msg = buf[:len(MSG)]
01837         self.assertEqual(msg, MSG)

Here is the call graph for this function:

Definition at line 1840 of file test_socket.py.

01840 
01841     def testRecvFromIntoMemoryview(self):
01842         buf = bytearray(1024)
01843         nbytes, addr = self.cli_conn.recvfrom_into(memoryview(buf))
01844         self.assertEqual(nbytes, len(MSG))
01845         msg = buf[:len(MSG)]
01846         self.assertEqual(msg, MSG)

Here is the call graph for this function:

Definition at line 1791 of file test_socket.py.

01791 
01792     def testRecvIntoArray(self):
01793         buf = bytearray(1024)
01794         nbytes = self.cli_conn.recv_into(buf)
01795         self.assertEqual(nbytes, len(MSG))
01796         msg = buf[:len(MSG)]
01797         self.assertEqual(msg, MSG)

Here is the call graph for this function:

Definition at line 1802 of file test_socket.py.

01802 
01803     def testRecvIntoBytearray(self):
01804         buf = bytearray(1024)
01805         nbytes = self.cli_conn.recv_into(buf)
01806         self.assertEqual(nbytes, len(MSG))
01807         msg = buf[:len(MSG)]
01808         self.assertEqual(msg, MSG)

Here is the call graph for this function:

Definition at line 1811 of file test_socket.py.

01811 
01812     def testRecvIntoMemoryview(self):
01813         buf = bytearray(1024)
01814         nbytes = self.cli_conn.recv_into(memoryview(buf))
01815         self.assertEqual(nbytes, len(MSG))
01816         msg = buf[:len(MSG)]
01817         self.assertEqual(msg, MSG)

Here is the call graph for this function:


Member Data Documentation

Definition at line 1838 of file test_socket.py.

Definition at line 1847 of file test_socket.py.

Definition at line 1809 of file test_socket.py.

Definition at line 1818 of file test_socket.py.

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: