~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-07-23 16:33:38 UTC
  • mto: This revision was merged to the branch mainline in revision 6045.
  • Revision ID: jelmer@samba.org-20110723163338-mjox55g52kt3u922
Add get_transport_from_url and get_transport_from_path functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1157
1157
 
1158
1158
    def permit_dir(self, name):
1159
1159
        """Permit a directory to be used by this test. See permit_url."""
1160
 
        name_transport = _mod_transport.get_transport(name)
 
1160
        name_transport = _mod_transport.get_transport_from_path(name)
1161
1161
        self.permit_url(name)
1162
1162
        self.permit_url(name_transport.base)
1163
1163
 
1242
1242
        self.addCleanup(transport_server.stop_server)
1243
1243
        # Obtain a real transport because if the server supplies a password, it
1244
1244
        # will be hidden from the base on the client side.
1245
 
        t = _mod_transport.get_transport(transport_server.get_url())
 
1245
        t = _mod_transport.get_transport_from_url(transport_server.get_url())
1246
1246
        # Some transport servers effectively chroot the backing transport;
1247
1247
        # others like SFTPServer don't - users of the transport can walk up the
1248
1248
        # transport to read the entire backing transport. This wouldn't matter
2360
2360
 
2361
2361
        :param relpath: a path relative to the base url.
2362
2362
        """
2363
 
        t = _mod_transport.get_transport(self.get_url(relpath))
 
2363
        t = _mod_transport.get_transport_from_url(self.get_url(relpath))
2364
2364
        self.assertFalse(t.is_readonly())
2365
2365
        return t
2366
2366
 
2591
2591
            backing_server = self.get_server()
2592
2592
        smart_server = test_server.SmartTCPServer_for_testing()
2593
2593
        self.start_server(smart_server, backing_server)
2594
 
        remote_transport = _mod_transport.get_transport(smart_server.get_url()
 
2594
        remote_transport = _mod_transport.get_transport_from_url(smart_server.get_url()
2595
2595
                                                   ).clone(path)
2596
2596
        return remote_transport
2597
2597