def scope_killer(): for _ in range(5): client = SSHClient(self.host, port=self.port, pkey=self.user_key, num_retries=1, allow_agent=False) channel = client.execute(self.cmd) output = list(client.read_output(channel)) self.assertListEqual(output, [b'me'])
def test_client_read_timeout(self): client = SSHClient(self.host, port=self.port, pkey=self.user_key, num_retries=1, timeout=0.2) channel, host, stdout, stderr, stdin = client.run_command( 'sleep 2; echo me') output_gen = client.read_output(channel) self.assertRaises(Timeout, list, output_gen)