summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-08-25 20:56:43 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-08-25 20:56:43 (GMT)
commit4f1353ab10792f47a51c37f1384f036a1679aec0 (patch)
tree2669d3bc20f4ec8fb83ef95b005aa93cc56df447 /Lib/test
parentc20a7b977e919f1c261e955d3013ffae9ed0702f (diff)
downloadcpython-4f1353ab10792f47a51c37f1384f036a1679aec0.zip
cpython-4f1353ab10792f47a51c37f1384f036a1679aec0.tar.gz
cpython-4f1353ab10792f47a51c37f1384f036a1679aec0.tar.bz2
#18833: add a test for test_telnetlib. Patch by Alex Volkov.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_telnetlib.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index 11e95e7..c9f2ccb 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -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=()):