def test_key_based_auth(self): server = 'localhost' port = 2222 username = '******' key_path = 'id_rsa' with temporary_key(filename=key_path): sftp = SFTPClient(server, port, username, private_key=key_path) sftp.put(os.path.realpath(__file__), os.path.basename(__file__))
def test_put_into_nested_directories(self): server = 'localhost' port = 2222 username = '******' password = '******' sftp = SFTPClient(server, port, username, password) local_path = os.path.realpath(__file__) remote_path = './tmp/subtmp/' + os.path.basename(__file__) sftp.put(local_path, remote_path)
def test_put_with_password(self): server = 'localhost' port = 2222 username = '******' password = '******' sftp = SFTPClient(server, port, username, password) local_path = os.path.realpath(__file__) remote_path = os.path.basename(__file__) sftp.put(local_path, remote_path)