File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 3535 os .path .sep .join ([os .path .dirname (__file__ ), 'test_client_private_key' ]))
3636
3737class SSHClientTest (unittest .TestCase ):
38-
38+
3939 def setUp (self ):
4040 self .fake_cmd = 'fake cmd'
4141 self .fake_resp = 'fake response'
@@ -133,6 +133,13 @@ def test_ssh_client_conn_failure(self):
133133 SSHClient , host , port = self .listen_port ,
134134 pkey = self .user_key , num_retries = 0 )
135135
136+ def test_ssh_client_timeout (self ):
137+ """Test connection timeout error"""
138+ with self .assertRaises (ConnectionErrorException ) as cm :
139+ SSHClient ('127.0.0.1' , port = self .listen_port ,
140+ pkey = self .user_key , num_retries = 0 , timeout = 1 )
141+
142+ self .assertEqual (cm .exception .args [1 ], 'timed out' )
136143
137144if __name__ == '__main__' :
138145 unittest .main ()
You can’t perform that action at this time.
0 commit comments