Skip to content

Commit 19f0bee

Browse files
author
Dan
committed
Clearer ssh exception in tests
1 parent ce57cd7 commit 19f0bee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_pssh_client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,16 @@ def test_pssh_client_ssh_exception(self):
194194
server = start_server({ self.fake_cmd : self.fake_resp },
195195
self.listen_socket,
196196
ssh_exception=True)
197-
client = ParallelSSHClient(['127.0.0.1'], port=self.listen_port,
198-
pkey=self.user_key)
197+
client = ParallelSSHClient(['127.0.0.1'],
198+
user='fakey', password='fakey',
199+
port=self.listen_port,
200+
pkey=paramiko.RSAKey.generate(1024),
201+
)
199202
# Handle exception
200203
try:
201204
client.run_command(self.fake_cmd)
202205
raise Exception("Expected SSHException, got none")
203-
except SSHException, ex:
206+
except SSHException:
204207
pass
205208
del client
206209
server.join()

0 commit comments

Comments
 (0)