~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/transport_util.py

  • Committer: Naoki INADA
  • Date: 2009-10-29 10:01:19 UTC
  • mto: (4634.97.3 2.0)
  • mto: This revision was merged to the branch mainline in revision 4798.
  • Revision ID: inada-n@klab.jp-20091029100119-uckv9t7ej2qrghw3
import doc-ja rev90

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
import bzrlib.hooks
18
18
 
65
65
    hooks = TransportHooks()
66
66
 
67
67
    def __init__(self, base, _from_transport=None):
68
 
        assert base.startswith(_hooked_scheme + '://')
 
68
        if not base.startswith(_hooked_scheme + '://'):
 
69
            raise ValueError(base)
69
70
        # We need to trick the backing transport class about the scheme used
70
71
        # We'll do the reverse when we need to talk to the backing server
71
72
        fake_base = _change_scheme_in(base, _hooked_scheme, _backing_scheme)
115
116
        return url
116
117
 
117
118
    def start_logging_connections(self):
118
 
        ConnectionHookedTransport.hooks.install_hook('_set_connection',
119
 
                                                     self._collect_connection)
 
119
        ConnectionHookedTransport.hooks.install_named_hook(
 
120
            '_set_connection', self._collect_connection, None)
120
121
        # uninstall our hooks when we are finished
121
122
        self.addCleanup(self.reset_hooks)
122
123