/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ssh_transport.py

  • Committer: Andrew Bennetts
  • Date: 2010-01-12 03:53:21 UTC
  • mfrom: (4948 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4964.
  • Revision ID: andrew.bennetts@canonical.com-20100112035321-hofpz5p10224ryj3
Merge lp:bzr, resolving conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
from bzrlib.tests import TestCase
18
18
from bzrlib.errors import SSHVendorNotFound, UnknownSSH
76
76
        manager = TestSSHVendorManager()
77
77
        self.assertRaises(SSHVendorNotFound, manager.get_vendor, {})
78
78
        manager.set_ssh_version_string("plink")
79
 
        self.assertIsInstance(manager.get_vendor({}), PLinkSubprocessVendor)
 
79
        # Auto-detect of plink vendor disabled, on Windows recommended
 
80
        # default ssh-client is paramiko
 
81
        # see https://bugs.launchpad.net/bugs/414743
 
82
        #~self.assertIsInstance(manager.get_vendor({}), PLinkSubprocessVendor)
 
83
        self.assertRaises(SSHVendorNotFound, manager.get_vendor, {})
80
84
 
81
85
    def test_cached_vendor(self):
82
86
        manager = TestSSHVendorManager()
128
132
        # Last cached value always checked first
129
133
        self.assertIs(manager.get_vendor({}), vendor)
130
134
 
 
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)
 
143
 
 
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)
 
153
 
131
154
 
132
155
class SubprocessVendorsTests(TestCase):
133
156