def test_run_command_with_port_username_and_privkey(self): expected = ['ssh', '-x', '-p', '2200', '-i', '/tmp/id_rsa', 'user@host', 'git-clone-url'] vendor = SubprocessSSHVendor() command = vendor.run_command( 'host', 'git-clone-url', username='******', port='2200', key_filename='/tmp/id_rsa') args = command.proc.args self.assertListEqual(expected, args[0])
def test_run_command_password(self): vendor = SubprocessSSHVendor() self.assertRaises(NotImplementedError, vendor.run_command, 'host', 'git-clone-url', password='******')
def test_run_command_password_and_privkey(self): vendor = SubprocessSSHVendor() self.assertRaises(NotImplementedError, vendor.run_command, 'host', 'git-clone-url', password='******', key_filename='/tmp/id_rsa')
def test_run_command_dashes(self): vendor = SubprocessSSHVendor() self.assertRaises(StrangeHostname, vendor.run_command, '--weird-host', 'git-clone-url')