1
# Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd
1
# Copyright (C) 2007-2010 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
132
132
# Last cached value always checked first
133
133
self.assertIs(manager.get_vendor({}), vendor)
135
def test_get_vendor_from_path_win32_plink(self):
136
manager = TestSSHVendorManager()
137
manager.set_ssh_version_string("plink: Release 0.60")
138
plink_path = "C:/Program Files/PuTTY/plink.exe"
139
vendor = manager.get_vendor({"BZR_SSH": plink_path})
140
self.assertIsInstance(vendor, PLinkSubprocessVendor)
141
args = vendor._get_vendor_specific_argv("user", "host", 22, ["bzr"])
142
self.assertEqual(args[0], plink_path)
144
def test_get_vendor_from_path_nix_openssh(self):
145
manager = TestSSHVendorManager()
146
manager.set_ssh_version_string(
147
"OpenSSH_5.1p1 Debian-5, OpenSSL, 0.9.8g 19 Oct 2007")
148
openssh_path = "/usr/bin/ssh"
149
vendor = manager.get_vendor({"BZR_SSH": openssh_path})
150
self.assertIsInstance(vendor, OpenSSHSubprocessVendor)
151
args = vendor._get_vendor_specific_argv("user", "host", 22, ["bzr"])
152
self.assertEqual(args[0], openssh_path)
136
155
class SubprocessVendorsTests(TestCase):