1010import logging
1111import gevent
1212import threading
13- import time
1413
1514_setup_logger (server_logger )
1615
@@ -25,38 +24,22 @@ def setUp(self):
2524 def cleanUp (self ):
2625 del self .listener
2726
28- def _run_client_exec_command (self ):
29- client = ParallelSSHClient (['localhost' ], port = self .listen_port )
30- cmd = client .exec_command (self .fake_cmd )[0 ]
31- output = client .get_stdout (cmd )
32- expected = {'localhost' : {'exit_code' : 0 }}
33- self .assertEqual (expected , output ,
34- msg = "Got unexpected command output - %s" % (output ,))
35- gevent .sleep (0 )
36- del client
37-
38- # def _run_client_fail_auth(self):
39- # try:
40- # except Exception:
41- # raise SystemExit
42-
4327 def test_pssh_client_exec_command (self ):
4428 server = listen ({ self .fake_cmd : self .fake_resp }, self .listener )
45- time .sleep (5 )
29+ gevent .sleep (5 )
4630 client = ParallelSSHClient (['localhost' ], port = self .listen_port )
4731 cmd = client .exec_command (self .fake_cmd )[0 ]
4832 output = client .get_stdout (cmd )
4933 expected = {'localhost' : {'exit_code' : 0 }}
5034 self .assertEqual (expected , output ,
5135 msg = "Got unexpected command output - %s" % (output ,))
52- gevent .sleep (0 )
5336 del client
5437 server .join ()
5538
5639 def test_pssh_client_auth_failure (self ):
5740 server = listen ({ self .fake_cmd : self .fake_resp },
5841 self .listener , fail_auth = True )
59- time .sleep (5 )
42+ gevent .sleep (5 )
6043 client = ParallelSSHClient (['localhost' ], port = self .listen_port )
6144 cmd = client .exec_command (self .fake_cmd )[0 ]
6245 # Handle exception
0 commit comments