~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/smart.py

  • Committer: Robert Collins
  • Date: 2007-03-28 07:33:07 UTC
  • mto: (2018.5.113 hpss)
  • mto: This revision was merged to the branch mainline in revision 2383.
  • Revision ID: robertc@robertcollins.net-20070328073307-ni7dcww9b1rf0udp
Split out hpss test fixes which dont depend on new or altered API's.

Show diffs side-by-side

added added

removed removed

Lines of Context:
903
903
        SmartTCPServer.__init__(self,
904
904
            transport.get_transport(urlutils.local_path_to_url('/')))
905
905
        
906
 
    def setUp(self):
 
906
    def get_backing_transport(self, backing_transport_server):
 
907
        """Get a backing transport from a server we are decorating."""
 
908
        return transport.get_transport(backing_transport_server.get_url())
 
909
 
 
910
    def setUp(self, backing_transport_server=None):
907
911
        """Set up server for testing"""
 
912
        from bzrlib.transport.chroot import TestingChrootServer
 
913
        if backing_transport_server is None:
 
914
            from bzrlib.transport.local import LocalURLServer
 
915
            backing_transport_server = LocalURLServer()
 
916
        self.chroot_server = TestingChrootServer()
 
917
        self.chroot_server.setUp(backing_transport_server)
 
918
        self.backing_transport = transport.get_transport(
 
919
            self.chroot_server.get_url())
908
920
        self.start_background_thread()
909
921
 
910
922
    def tearDown(self):
911
923
        self.stop_background_thread()
912
924
 
913
 
    def get_url(self):
914
 
        """Return the url of the server"""
915
 
        host, port = self._server_socket.getsockname()
916
 
        return "bzr://%s:%d%s" % (host, port, urlutils.escape(self._homedir))
917
 
 
918
925
    def get_bogus_url(self):
919
926
        """Return a URL which will fail to connect"""
920
927
        return 'bzr://127.0.0.1:1/'