summaryrefslogtreecommitdiff
path: root/Lib/test/test_telnetlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_telnetlib.py')
-rw-r--r--Lib/test/test_telnetlib.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index 95eebf3cbc..c9f2ccb462 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -36,6 +36,7 @@ class GeneralTests(TestCase):
def tearDown(self):
self.thread.join()
+ del self.thread # Clear out any dangling Thread objects.
def testBasic(self):
# connects
@@ -74,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=()):