|
@@ -51,7 +51,7 @@ from dulwich.client import (
|
|
|
SendPackError,
|
|
|
StrangeHostname,
|
|
|
SubprocessSSHVendor,
|
|
|
- PuttySSHVendor,
|
|
|
+ PLinkSSHVendor,
|
|
|
UpdateRefsError,
|
|
|
default_urllib3_manager,
|
|
|
get_transport_and_path,
|
|
@@ -1041,7 +1041,7 @@ class SubprocessSSHVendorTests(TestCase):
|
|
|
self.assertListEqual(expected, args[0])
|
|
|
|
|
|
|
|
|
-class PuttySSHVendorTests(TestCase):
|
|
|
+class PLinkSSHVendorTests(TestCase):
|
|
|
|
|
|
def setUp(self):
|
|
|
# Monkey Patch client subprocess popen
|
|
@@ -1052,24 +1052,24 @@ class PuttySSHVendorTests(TestCase):
|
|
|
dulwich.client.subprocess.Popen = self._orig_popen
|
|
|
|
|
|
def test_run_command_dashes(self):
|
|
|
- vendor = PuttySSHVendor()
|
|
|
+ vendor = PLinkSSHVendor()
|
|
|
self.assertRaises(StrangeHostname, vendor.run_command, '--weird-host',
|
|
|
'git-clone-url')
|
|
|
|
|
|
def test_run_command_password_and_privkey(self):
|
|
|
- vendor = PuttySSHVendor()
|
|
|
+ vendor = PLinkSSHVendor()
|
|
|
self.assertRaises(NotImplementedError, vendor.run_command,
|
|
|
'host', 'git-clone-url',
|
|
|
password='12345', key_filename='/tmp/id_rsa')
|
|
|
|
|
|
def test_run_command_password(self):
|
|
|
if sys.platform == 'win32':
|
|
|
- binary = ['putty.exe', '-ssh']
|
|
|
+ binary = ['plink.exe', '-ssh']
|
|
|
else:
|
|
|
- binary = ['putty', '-ssh']
|
|
|
+ binary = ['plink', '-ssh']
|
|
|
expected = binary + ['-pw', '12345', 'host', 'git-clone-url']
|
|
|
|
|
|
- vendor = PuttySSHVendor()
|
|
|
+ vendor = PLinkSSHVendor()
|
|
|
|
|
|
warnings.simplefilter("always", UserWarning)
|
|
|
self.addCleanup(warnings.resetwarnings)
|
|
@@ -1079,7 +1079,7 @@ class PuttySSHVendorTests(TestCase):
|
|
|
command = vendor.run_command('host', 'git-clone-url', password='12345')
|
|
|
|
|
|
expected_warning = UserWarning(
|
|
|
- 'Invoking Putty with a password exposes the password in the '
|
|
|
+ 'Invoking PLink with a password exposes the password in the '
|
|
|
'process list.')
|
|
|
|
|
|
for w in warnings_list:
|
|
@@ -1097,14 +1097,14 @@ class PuttySSHVendorTests(TestCase):
|
|
|
|
|
|
def test_run_command_with_port_username_and_privkey(self):
|
|
|
if sys.platform == 'win32':
|
|
|
- binary = ['putty.exe', '-ssh']
|
|
|
+ binary = ['plink.exe', '-ssh']
|
|
|
else:
|
|
|
- binary = ['putty', '-ssh']
|
|
|
+ binary = ['plink', '-ssh']
|
|
|
expected = binary + [
|
|
|
'-P', '2200', '-i', '/tmp/id_rsa',
|
|
|
'user@host', 'git-clone-url']
|
|
|
|
|
|
- vendor = PuttySSHVendor()
|
|
|
+ vendor = PLinkSSHVendor()
|
|
|
command = vendor.run_command(
|
|
|
'host', 'git-clone-url',
|
|
|
username='user', port='2200',
|