mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 22:14:53 +02:00
Remote file transfer: Fix transfer not working is custom ssh port or identity is specified on the SSH command line
Fixes #4067
This commit is contained in:
25
kitty_tests/ssh.py
Normal file
25
kitty_tests/ssh.py
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
|
||||
import os
|
||||
from . import BaseTest
|
||||
|
||||
from kittens.ssh.main import get_connection_data
|
||||
from kitty.utils import SSHConnectionData
|
||||
|
||||
|
||||
class SSHTest(BaseTest):
|
||||
|
||||
def test_ssh_connection_data(self):
|
||||
def t(cmdline, binary='ssh', host='main', port=None, identity_file=''):
|
||||
if identity_file:
|
||||
identity_file = os.path.abspath(identity_file)
|
||||
q = get_connection_data(cmdline.split())
|
||||
self.ae(q, SSHConnectionData(binary, host, port, identity_file))
|
||||
|
||||
t('ssh main')
|
||||
t('ssh un@ip -i ident -p34', host='un@ip', port=34, identity_file='ident')
|
||||
t('ssh un@ip -iident -p34', host='un@ip', port=34, identity_file='ident')
|
||||
t('ssh -p 33 main', port=33)
|
||||
Reference in New Issue
Block a user