b.t.t.TestServer(transport.Server) : class documentation

Part of bzrlib.tests.test_server View In Hierarchy

Known subclasses: bzrlib.tests.ftp_server.medusa_based.FTPTestServer, bzrlib.tests.ftp_server.pyftpdlib_based.FTPTestServer, bzrlib.tests.test_server.DecoratorServer, bzrlib.tests.test_server.LocalURLServer, bzrlib.transport.gio_transport.GioLocalURLServer

A Transport Server dedicated to tests.

The TestServer interface provides a server for a given transport. We use these servers as loopback testing tools. For any given transport the Servers it provides must either allow writing, or serve the contents of os.getcwdu() at the time start_server is called.

Note that these are real servers - they must implement all the things that we want bzr transports to take advantage of.

Method get_url Return a url for this server.
Method get_bogus_url Return a url for this protocol, that will fail to connect.

Inherited from Server:

Method start_server Setup the server to service requests.
Method stop_server Remove the server and cleanup any resources it owns.
def get_url(self):
Return a url for this server.

If the transport does not represent a disk directory (i.e. it is a database like svn, or a memory only transport, it should return a connection to a newly established resource for this Server. Otherwise it should return a url that will provide access to the path that was os.getcwdu() when start_server() was called.

Subsequent calls will return the same resource.

def get_bogus_url(self):
Return a url for this protocol, that will fail to connect.

This may raise NotImplementedError to indicate that this server cannot provide bogus urls.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.