#18833: add a test for test_telnetlib. Patch by Alex Volkov.
This commit is contained in:
parent
c20a7b977e
commit
4f1353ab10
|
@ -75,6 +75,14 @@ class GeneralTests(TestCase):
|
|||
self.assertEqual(telnet.sock.gettimeout(), 30)
|
||||
telnet.sock.close()
|
||||
|
||||
def testGetters(self):
|
||||
# Test telnet getter methods
|
||||
telnet = telnetlib.Telnet(HOST, self.port, timeout=30)
|
||||
t_sock = telnet.sock
|
||||
self.assertEqual(telnet.get_socket(), t_sock)
|
||||
self.assertEqual(telnet.fileno(), t_sock.fileno())
|
||||
telnet.sock.close()
|
||||
|
||||
class SocketStub(object):
|
||||
''' a socket proxy that re-defines sendall() '''
|
||||
def __init__(self, reads=()):
|
||||
|
|
Loading…
Reference in New Issue