Back to index

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

List of all members.

Public Member Functions

def setUp
def tearDown
def testBasic
def testTimeoutDefault
def testTimeoutNone
def testTimeoutValue
def testTimeoutOpen

Public Attributes

 evt
 sock
 port
 thread

Detailed Description

Definition at line 26 of file test_telnetlib.py.


Member Function Documentation

Definition at line 28 of file test_telnetlib.py.

00028 
00029     def setUp(self):
00030         self.evt = threading.Event()
00031         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
00032         self.sock.settimeout(3)
00033         self.port = support.bind_port(self.sock)
00034         self.thread = threading.Thread(target=server, args=(self.evt,self.sock))
00035         self.thread.start()
00036         self.evt.wait()
00037         self.evt.clear()
00038         time.sleep(.1)

Here is the caller graph for this function:

Definition at line 39 of file test_telnetlib.py.

00039 
00040     def tearDown(self):
00041         self.evt.wait()
00042         self.thread.join()

Here is the caller graph for this function:

Definition at line 43 of file test_telnetlib.py.

00043 
00044     def testBasic(self):
00045         # connects
00046         telnet = telnetlib.Telnet(HOST, self.port)
00047         telnet.sock.close()

Definition at line 48 of file test_telnetlib.py.

00048 
00049     def testTimeoutDefault(self):
00050         self.assertTrue(socket.getdefaulttimeout() is None)
00051         socket.setdefaulttimeout(30)
00052         try:
00053             telnet = telnetlib.Telnet("localhost", self.port)
00054         finally:
00055             socket.setdefaulttimeout(None)
00056         self.assertEqual(telnet.sock.gettimeout(), 30)
00057         telnet.sock.close()

Here is the call graph for this function:

Definition at line 58 of file test_telnetlib.py.

00058 
00059     def testTimeoutNone(self):
00060         # None, having other default
00061         self.assertTrue(socket.getdefaulttimeout() is None)
00062         socket.setdefaulttimeout(30)
00063         try:
00064             telnet = telnetlib.Telnet(HOST, self.port, timeout=None)
00065         finally:
00066             socket.setdefaulttimeout(None)
00067         self.assertTrue(telnet.sock.gettimeout() is None)
00068         telnet.sock.close()

Here is the call graph for this function:

Definition at line 74 of file test_telnetlib.py.

00074 
00075     def testTimeoutOpen(self):
00076         telnet = telnetlib.Telnet()
00077         telnet.open("localhost", self.port, timeout=30)
00078         self.assertEqual(telnet.sock.gettimeout(), 30)
00079         telnet.sock.close()

Here is the call graph for this function:

Definition at line 69 of file test_telnetlib.py.

00069 
00070     def testTimeoutValue(self):
00071         telnet = telnetlib.Telnet("localhost", self.port, timeout=30)
00072         self.assertEqual(telnet.sock.gettimeout(), 30)
00073         telnet.sock.close()

Here is the call graph for this function:


Member Data Documentation

Definition at line 29 of file test_telnetlib.py.

Definition at line 32 of file test_telnetlib.py.

Definition at line 30 of file test_telnetlib.py.

Definition at line 33 of file test_telnetlib.py.


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