~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/transport_util.py

(gz) Fix test failure on alpha by correcting format string for
 gc_chk_sha1_record (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    """Dict-mapping hook name to a list of callables for transport hooks"""
48
48
 
49
49
    def __init__(self):
50
 
        super(TransportHooks, self).__init__("bzrlib.tests.transport_util",
51
 
            "InstrumentedTransport.hooks")
 
50
        super(TransportHooks, self).__init__()
52
51
        # Invoked when the transport has just created a new connection.
53
52
        # The api signature is (transport, connection, credentials)
54
53
        self['_set_connection'] = []
77
76
            fake_base, _from_transport=_from_transport)
78
77
        # The following is needed to minimize the effects of our trick above
79
78
        # while retaining the best compatibility.
80
 
        self._parsed_url.scheme = _hooked_scheme
81
 
        super(ConnectedTransport, self).__init__(str(self._parsed_url))
 
79
        self._scheme = _hooked_scheme
 
80
        base = self._unsplit_url(self._scheme,
 
81
                                 self._user, self._password,
 
82
                                 self._host, self._port,
 
83
                                 self._path)
 
84
        super(ConnectedTransport, self).__init__(base)
82
85
 
83
86
 
84
87
class ConnectionHookedTransport(InstrumentedTransport):
108
111
        # standard test support code will work and permit the server url
109
112
        # correctly.
110
113
        url = self.get_url()
111
 
        t = transport.get_transport_from_url(url)
 
114
        t = transport.get_transport(url)
112
115
        if t.base.endswith('work/'):
113
116
            t = t.clone('../..')
114
117
        self.permit_url(t.base)