summaryrefslogtreecommitdiffhomepage
path: root/tests/test_client.py
diff options
context:
space:
mode:
authorPierce Lopez <pierce.lopez@gmail.com>2017-06-06 18:13:30 -0400
committerPierce Lopez <pierce.lopez@gmail.com>2017-06-07 00:38:04 -0400
commit500e2641981f504a7a9a744305935360f5973222 (patch)
treee6b7af541bf675784fd0e429a4eadaef4e1167dc /tests/test_client.py
parentddb277d4e4989e914b67ff26c14c7c298e7fab9f (diff)
cleanup/simplify auth_timeout tests
Diffstat (limited to 'tests/test_client.py')
-rw-r--r--tests/test_client.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index aa3ff59b..ad0561f2 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -36,7 +36,7 @@ from tests.util import test_path
import paramiko
from paramiko.common import PY2
-from paramiko.ssh_exception import SSHException
+from paramiko.ssh_exception import SSHException, AuthenticationException
FINGERPRINTS = {
@@ -391,18 +391,12 @@ class SSHClientTest (unittest.TestCase):
"""
verify that the SSHClient has a configurable auth timeout
"""
- threading.Thread(target=self._run).start()
- host_key = paramiko.RSAKey.from_private_key_file(test_path('test_rsa.key'))
- public_host_key = paramiko.RSAKey(data=host_key.asbytes())
-
- self.tc = paramiko.SSHClient()
- self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key)
# Connect with a half second auth timeout
- kwargs = dict(self.connect_kwargs, password='unresponsive-server', auth_timeout=0.5)
self.assertRaises(
- paramiko.AuthenticationException,
- self.tc.connect,
- **kwargs
+ AuthenticationException,
+ self._test_connection,
+ password='unresponsive-server',
+ auth_timeout=0.5,
)
def test_update_environment(self):