summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorOlle Lundberg <olle@spotify.com>2015-02-24 14:49:36 +0100
committerOlle Lundberg <olle@spotify.com>2015-02-24 15:01:27 +0100
commitd1f72859c76beda46a072cdc75b2e19e4418275a (patch)
treef9a7b4df86088185b0cdd6ffa91b567f3e19722e /tests
parentb98ba1c5bb6ff1d968e9105ff093d360ac9091e9 (diff)
Expose handshake timeout in the transport API.
This is a reimplementation of #62.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_transport.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_transport.py b/tests/test_transport.py
index 5cf9a867..3c8ad81e 100644
--- a/tests/test_transport.py
+++ b/tests/test_transport.py
@@ -792,3 +792,20 @@ class TransportTest(unittest.TestCase):
(None, DEFAULT_WINDOW_SIZE),
(2**32, MAX_WINDOW_SIZE)]:
self.assertEqual(self.tc._sanitize_window_size(val), correct)
+
+ def test_L_handshake_timeout(self):
+ """
+ verify that we can get a hanshake timeout.
+ """
+ host_key = RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = RSAKey(data=host_key.asbytes())
+ self.ts.add_server_key(host_key)
+ event = threading.Event()
+ server = NullServer()
+ self.assertTrue(not event.is_set())
+ self.tc.handshake_timeout = 0.000000000001
+ self.ts.start_server(event, server)
+ self.assertRaises(EOFError, self.tc.connect,
+ hostkey=public_host_key,
+ username='slowdive',
+ password='pygmalion')