Пример #1
0
 def _create_ssh_client(self):
     client = SSHClient('localhost', prompt='$ ')
     self._login_client(client)
     return client
Пример #2
0
 def test_login_close_and_login_again(self):
     s = SSHClient('localhost', prompt='$ ')
     s.login('test', 'test')
     s.execute_command('ls')
     s.close()
     s.login('test', 'test')
     s.execute_command('ls')
Пример #3
0
 def test_read_until_regexp_with_prefix(self):
     s = SSHClient('localhost', prompt='$ ')
     s.login('test', 'test')
     s.write('faa')
     s.read_until_regexp_with_prefix(r'foo\sfaa', 'foo ')
     s.close()
Пример #4
0
 def test_login_close_and_login_again(self):
     s = SSHClient('localhost', prompt='$ ')
     s.login('test', 'test')
     s.execute_command('ls')
     s.close()
     s.login('test', 'test')
     s.execute_command('ls')
Пример #5
0
 def test_read_until_regexp_with_prefix(self):
     s = SSHClient('localhost', prompt='$ ')
     s.login('test', 'test')
     s.write('faa')
     s.read_until_regexp_with_prefix(r'foo\sfaa', 'foo ')
     s.close()