/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/transport_util.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-14 00:01:32 UTC
  • mfrom: (4957.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100114000132-3p3rabnonjw3gzqb
(jam) Merge bzr.stable, bringing in bug fixes #175839, #504390

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007, 2009 Canonical Ltd
2
2
#
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
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
import bzrlib.hooks
 
18
from bzrlib.tests import features
18
19
 
19
20
# SFTPTransport offers better performances but relies on paramiko, if paramiko
20
21
# is not available, we fallback to FtpTransport
21
 
from bzrlib.tests import test_sftp_transport
22
 
if test_sftp_transport.paramiko_loaded:
 
22
if features.paramiko.available():
 
23
    from bzrlib.tests import test_sftp_transport
23
24
    from bzrlib.transport import sftp
24
25
    _backing_scheme = 'sftp'
25
26
    _backing_transport_class = sftp.SFTPTransport
33
34
 
34
35
from bzrlib.transport import (
35
36
    ConnectedTransport,
 
37
    get_transport,
36
38
    register_transport,
37
39
    register_urlparse_netloc_protocol,
38
40
    unregister_transport,
106
108
        self.addCleanup(unregister)
107
109
        super(TestCaseWithConnectionHookedTransport, self).setUp()
108
110
        self.reset_connections()
 
111
        # Add the 'hooked' url to the permitted url list.
 
112
        # XXX: See TestCase.start_server. This whole module shouldn't need to
 
113
        # exist - a bug has been filed on that. once its cleanedup/removed, the
 
114
        # standard test support code will work and permit the server url
 
115
        # correctly.
 
116
        url = self.get_url()
 
117
        t = get_transport(url)
 
118
        if t.base.endswith('work/'):
 
119
            t = t.clone('../..')
 
120
        self.permit_url(t.base)
109
121
 
110
122
    def get_url(self, relpath=None):
111
123
        super_self = super(TestCaseWithConnectionHookedTransport, self)