~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ssh_transport.py

  • Committer: Matthew Gordon
  • Date: 2010-09-28 01:54:16 UTC
  • mfrom: (5444.2.3 bzr)
  • mto: This revision was merged to the branch mainline in revision 5462.
  • Revision ID: mgordon@ivs3d.com-20100928015416-9fyoav3grsxdhlrv
Moving bug fix into the proper branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    OpenSSHSubprocessVendor,
21
21
    PLinkSubprocessVendor,
22
22
    SSHCorpSubprocessVendor,
 
23
    LSHSubprocessVendor,
23
24
    SSHVendorManager,
24
25
    )
25
26
 
72
73
        manager.set_ssh_version_string("SSH Secure Shell")
73
74
        self.assertIsInstance(manager.get_vendor({}), SSHCorpSubprocessVendor)
74
75
 
 
76
    def test_get_vendor_by_inspection_lsh(self):
 
77
        manager = TestSSHVendorManager()
 
78
        self.assertRaises(SSHVendorNotFound, manager.get_vendor, {})
 
79
        manager.set_ssh_version_string("lsh")
 
80
        self.assertIsInstance(manager.get_vendor({}), LSHSubprocessVendor)
 
81
 
75
82
    def test_get_vendor_by_inspection_plink(self):
76
83
        manager = TestSSHVendorManager()
77
84
        self.assertRaises(SSHVendorNotFound, manager.get_vendor, {})
202
209
                "-s", "sftp", "host"]
203
210
            )
204
211
 
 
212
    def test_lsh_command_arguments(self):
 
213
        vendor = LSHSubprocessVendor()
 
214
        self.assertEqual(
 
215
            vendor._get_vendor_specific_argv(
 
216
                "user", "host", 100, command=["bzr"]),
 
217
            ["lsh",
 
218
                "-p", "100",
 
219
                "-l", "user",
 
220
                "host", "bzr"]
 
221
            )
 
222
 
 
223
    def test_lsh_subsystem_arguments(self):
 
224
        vendor = LSHSubprocessVendor()
 
225
        self.assertEqual(
 
226
            vendor._get_vendor_specific_argv(
 
227
                "user", "host", 100, subsystem="sftp"),
 
228
            ["lsh",
 
229
                "-p", "100",
 
230
                "-l", "user",
 
231
                "--subsystem", "sftp", "host"]
 
232
            )
 
233
 
205
234
    def test_plink_command_arguments(self):
206
235
        vendor = PLinkSubprocessVendor()
207
236
        self.assertEqual(