/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/blackbox/test_serve.py

Implement ParamikoVendor.connect_ssh

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
            raise TestSkipped('Paramiko not installed')
121
121
        
122
122
        from bzrlib.tests.stub_sftp import StubServer
123
 
        from paramiko.common import AUTH_SUCCESSFUL
124
 
 
125
 
        # XXX: Eventually, all SSH vendor classes should implement connect_ssh,
126
 
        # and this TestSkipped can be removed.
127
 
        from bzrlib.transport.ssh import _get_ssh_vendor, SSHVendor
128
 
        vendor = _get_ssh_vendor()
129
 
        if vendor.connect_ssh.im_func == SSHVendor.connect_ssh.im_func:
130
 
            raise TestSkipped(
131
 
                'connect_ssh is not yet implemented on %r' % vendor)
132
123
 
133
124
        # Make a branch
134
125
        self.make_branch('a_branch')
142
133
 
143
134
            test = self
144
135
 
145
 
            def get_allowed_auths(self, username):
146
 
                return 'none'
147
 
 
148
 
            def check_auth_none(self, username):
149
 
                return AUTH_SUCCESSFUL
150
 
            
151
136
            def check_channel_exec_request(self, channel, command):
152
137
                self.test.command_executed = command
153
138
                proc = subprocess.Popen(
181
166
        ssh_server = SFTPServer(StubSSHServer)
182
167
        # XXX: We *don't* want to override the default SSH vendor, so we set
183
168
        # _vendor to what _get_ssh_vendor returns.
184
 
        ssh_server._vendor = vendor
185
169
        ssh_server.setUp()
186
170
        self.addCleanup(ssh_server.tearDown)
187
171
        port = ssh_server._listener.port
194
178
        os.environ['BZR_REMOTE_PATH'] = self.get_bzr_path()
195
179
        try:
196
180
            branch = Branch.open(
197
 
                'bzr+ssh://localhost:%d%s' % (port, path_to_branch))
 
181
                'bzr+ssh://fred:secret@localhost:%d%s' % (port, path_to_branch))
198
182
            
199
183
            branch.repository.get_revision_graph()
200
184
            self.assertEqual(None, branch.last_revision())