Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_asyncore Namespace Reference

Classes

class  dummysocket
class  dummychannel
class  exitingdummy
class  crashingdummy
class  HelperFunctionTests
class  DispatcherTests
class  dispatcherwithsend_noread
class  DispatcherWithSendTests
class  DispatcherWithSendTests_UsePoll
class  FileWrapperTest
class  BaseTestHandler
class  TCPServer
class  BaseClient
class  BaseTestAPI
class  TestAPI_UseSelect
class  TestAPI_UsePoll

Functions

def capture_server
def test_main

Variables

 threading = None
 HOST = support.HOST

Function Documentation

def test.test_asyncore.capture_server (   evt,
  buf,
  serv 
)

Definition at line 66 of file test_asyncore.py.

00066 
00067 def capture_server(evt, buf, serv):
00068     try:
00069         serv.listen(5)
00070         conn, addr = serv.accept()
00071     except socket.timeout:
00072         pass
00073     else:
00074         n = 200
00075         while n > 0:
00076             r, w, e = select.select([conn], [], [])
00077             if r:
00078                 data = conn.recv(10)
00079                 # keep everything except for the newline terminator
00080                 buf.write(data.replace(b'\n', b''))
00081                 if b'\n' in data:
00082                     break
00083             n -= 1
00084             time.sleep(0.01)
00085 
00086         conn.close()
00087     finally:
00088         serv.close()
00089         evt.set()
00090 

Definition at line 742 of file test_asyncore.py.

00742 
00743 def test_main():
00744     tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
00745              DispatcherWithSendTests_UsePoll, TestAPI_UseSelect,
00746              TestAPI_UsePoll, FileWrapperTest]
00747     run_unittest(*tests)

Here is the call graph for this function:


Variable Documentation

Definition at line 21 of file test_asyncore.py.

Definition at line 19 of file test_asyncore.py.