Back to index

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

Classes

class  GeneralTests
class  SocketStub
class  TelnetAlike
class  ReadTests
class  nego_collector
class  WriteTests
class  OptionTests

Functions

def server
def new_select
def test_socket
def test_telnet
def test_main

Variables

tuple threading = support.import_module('threading')
 HOST = support.HOST
 tl = telnetlib

Function Documentation

Definition at line 109 of file test_telnetlib.py.

00109 
00110 def new_select(*s_args):
00111     block = False
00112     for l in s_args:
00113         for fob in l:
00114             if isinstance(fob, TelnetAlike):
00115                 block = fob.sock.block
00116     if block:
00117         return [[], [], []]
00118     else:
00119         return s_args
00120 
@contextlib.contextmanager
def test.test_telnetlib.server (   evt,
  serv 
)

Definition at line 13 of file test_telnetlib.py.

00013 
00014 def server(evt, serv):
00015     serv.listen(5)
00016     evt.set()
00017     try:
00018         conn, addr = serv.accept()
00019     except socket.timeout:
00020         pass
00021     else:
00022         conn.close()
00023     finally:
00024         serv.close()
00025         evt.set()

def test.test_telnetlib.test_main (   verbose = None)

Definition at line 356 of file test_telnetlib.py.

00356 
00357 def test_main(verbose=None):
00358     support.run_unittest(GeneralTests, ReadTests, WriteTests, OptionTests)

Definition at line 121 of file test_telnetlib.py.

00121 
00122 def test_socket(reads):
00123     def new_conn(*ignored):
00124         return SocketStub(reads)
00125     try:
00126         old_conn = socket.create_connection
00127         socket.create_connection = new_conn
00128         yield None
00129     finally:
00130         socket.create_connection = old_conn
00131     return

Here is the caller graph for this function:

def test.test_telnetlib.test_telnet (   reads = [],
  cls = TelnetAlike 
)
return a telnetlib.Telnet object that uses a SocketStub with
    reads queued up to be read 

Definition at line 132 of file test_telnetlib.py.

00132 
00133 def test_telnet(reads=[], cls=TelnetAlike):
00134     ''' return a telnetlib.Telnet object that uses a SocketStub with
00135         reads queued up to be read '''
00136     for x in reads:
00137         assert type(x) is bytes, x
00138     with test_socket(reads):
00139         telnet = cls('dummy', 0)
00140         telnet._messages = '' # debuglevel output
00141     return telnet

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 11 of file test_telnetlib.py.

Definition at line 9 of file test_telnetlib.py.

Definition at line 258 of file test_telnetlib.py.