]> granicus.if.org Git - python/commitdiff
#18833: add a test for test_telnetlib. Patch by Alex Volkov.
authorEzio Melotti <ezio.melotti@gmail.com>
Sun, 25 Aug 2013 20:56:43 +0000 (23:56 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Sun, 25 Aug 2013 20:56:43 +0000 (23:56 +0300)
Lib/test/test_telnetlib.py
Misc/ACKS

index 11e95e77b75ffa9418fd2cc0aa963e8431dbfa6c..c9f2ccb462f834d40a9d0d28857dbeaa9064c366 100644 (file)
@@ -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=()):
index 78d3b47de94426ba581cdb0408e048b19a0c2317..9596db71d225a3a9027271a85f486eaf22604968 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1286,6 +1286,7 @@ Norman Vine
 Pauli Virtanen
 Frank Visser
 Johannes Vogel
+Alex Volkov
 Martijn Vries
 Sjoerd de Vries
 Niki W. Waibel