Back to index

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

List of all members.

Public Member Functions

def __init__
def testDefaults
def testRecv
def testSend
def setUp
def tearDown
def clientSetUp
def clientTearDown
def serverExplicitReady
def clientRun

Public Attributes

 cli
 serv
 setUp
 tearDown
 server_ready
 client_ready
 done
 queue
 client_thread

Private Member Functions

def _check_defaults
def _testDefaults
def _testRecv
def _testSend

Detailed Description

Definition at line 944 of file test_socket.py.


Constructor & Destructor Documentation

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

Reimplemented from test.test_socket.SocketPairTest.

Definition at line 946 of file test_socket.py.

00946 
00947     def __init__(self, methodName='runTest'):
00948         SocketPairTest.__init__(self, methodName=methodName)

Here is the caller graph for this function:


Member Function Documentation

def test.test_socket.BasicSocketPairTest._check_defaults (   self,
  sock 
) [private]

Definition at line 949 of file test_socket.py.

00949 
00950     def _check_defaults(self, sock):
00951         self.assertIsInstance(sock, socket.socket)
00952         if hasattr(socket, 'AF_UNIX'):
00953             self.assertEqual(sock.family, socket.AF_UNIX)
00954         else:
00955             self.assertEqual(sock.family, socket.AF_INET)
00956         self.assertEqual(sock.type, socket.SOCK_STREAM)
00957         self.assertEqual(sock.proto, 0)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 958 of file test_socket.py.

00958 
00959     def _testDefaults(self):
00960         self._check_defaults(self.cli)

Here is the call graph for this function:

Definition at line 968 of file test_socket.py.

00968 
00969     def _testRecv(self):
00970         self.cli.send(MSG)

Definition at line 974 of file test_socket.py.

00974 
00975     def _testSend(self):
00976         msg = self.cli.recv(1024)
00977         self.assertEqual(msg, MSG)
00978 
@unittest.skipUnless(thread, 'Threading required for this test.')

Here is the call graph for this function:

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:

def test.test_socket.SocketPairTest.clientSetUp (   self) [inherited]

Reimplemented from test.test_socket.ThreadableTest.

Definition at line 251 of file test_socket.py.

00251 
00252     def clientSetUp(self):
00253         pass

Reimplemented from test.test_socket.ThreadableTest.

Definition at line 254 of file test_socket.py.

00254 
00255     def clientTearDown(self):
00256         self.cli.close()
00257         self.cli = None
00258         ThreadableTest.clientTearDown(self)
00259 

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.SocketPairTest.setUp (   self) [inherited]

Definition at line 244 of file test_socket.py.

00244 
00245     def setUp(self):
00246         self.serv, self.cli = socket.socketpair()

Here is the caller graph for this function:

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

Definition at line 247 of file test_socket.py.

00247 
00248     def tearDown(self):
00249         self.serv.close()
00250         self.serv = None

Here is the caller graph for this function:

Definition at line 961 of file test_socket.py.

00961 
00962     def testDefaults(self):
00963         self._check_defaults(self.serv)

Here is the call graph for this function:

Definition at line 964 of file test_socket.py.

00964 
00965     def testRecv(self):
00966         msg = self.serv.recv(1024)
00967         self.assertEqual(msg, MSG)

Here is the call graph for this function:

Definition at line 971 of file test_socket.py.

00971 
00972     def testSend(self):
00973         self.serv.send(MSG)


Member Data Documentation

Definition at line 245 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.

Definition at line 134 of file test_socket.py.

Definition at line 249 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: