def setUp(self):
     super(TestTransportDispatch, self).setUp()
     memory_server = MemoryServer()
     memory_server.start_server()
     base_transport = get_transport(memory_server.get_url())
     base_transport.mkdir('hosted')
     self.hosted_transport = base_transport.clone('hosted')
     self.factory = TransportDispatch(self.hosted_transport)
 def setUp(self):
     super(TestTransportDispatch, self).setUp()
     memory_server = MemoryServer()
     memory_server.start_server()
     base_transport = get_transport(memory_server.get_url())
     base_transport.mkdir('hosted')
     self.hosted_transport = base_transport.clone('hosted')
     self.factory = TransportDispatch(self.hosted_transport)
示例#3
0
 def setup_memory(self):
     """Create a memory url server and return its url."""
     # XXX: integrate with ui.here better.
     self.transport_factory = MemoryServer()
     self.transport_factory.start_server()
     self.addCleanup(self.transport_factory.stop_server)
     self.addCleanup(memory_transport_stat.install())
     return self.transport_factory.get_url()
示例#4
0
class ResourcedTestCase(TestCase):
    """Make all l_mirror tests have resource support."""

    resources = []

    def setUp(self):
        TestCase.setUp(self)
        result = testresources._get_result()
        testresources.setUpResources(self, self.resources, result)
        self.addCleanup(
            testresources.tearDownResources, self, self.resources, result)

    def setup_memory(self):
        """Create a memory url server and return its url."""
        # XXX: integrate with ui.here better.
        self.transport_factory = MemoryServer()
        self.transport_factory.start_server()
        self.addCleanup(self.transport_factory.stop_server)
        self.addCleanup(memory_transport_stat.install())
        return self.transport_factory.get_url()
示例#5
0
    def _makeControlTransport(self, default_stack_on, trailing_path=None):
        """Make a transport that points to a control directory.

        A control directory is a .bzr directory containing a 'control.conf'
        file. This is used to specify configuration for branches created
        underneath the directory that contains the control directory.

        :param default_stack_on: The default stacked-on branch URL for
            branches that respect this control directory. If empty, then
            we'll return an empty memory transport.
        :return: A read-only `MemoryTransport` containing a working BzrDir,
            configured to use the given default stacked-on location.
        """
        memory_server = MemoryServer()
        memory_server.start_server()
        transport = get_transport(memory_server.get_url())
        if default_stack_on == "":
            return transport
        format = BzrDirFormat.get_default_format()
        bzrdir = format.initialize_on_transport(transport)
        bzrdir.get_config().set_default_stack_on(urlutils.unescape(default_stack_on))
        return get_readonly_transport(transport)
示例#6
0
    def _makeControlTransport(self, default_stack_on, trailing_path=None):
        """Make a transport that points to a control directory.

        A control directory is a .bzr directory containing a 'control.conf'
        file. This is used to specify configuration for branches created
        underneath the directory that contains the control directory.

        :param default_stack_on: The default stacked-on branch URL for
            branches that respect this control directory. If empty, then
            we'll return an empty memory transport.
        :return: A read-only `MemoryTransport` containing a working BzrDir,
            configured to use the given default stacked-on location.
        """
        memory_server = MemoryServer()
        memory_server.start_server()
        transport = get_transport(memory_server.get_url())
        if default_stack_on == '':
            return transport
        format = BzrDirFormat.get_default_format()
        bzrdir = format.initialize_on_transport(transport)
        bzrdir.get_config().set_default_stack_on(
            urlutils.unescape(default_stack_on))
        return get_readonly_transport(transport)
 def setUp(self):
     super(TestBranchTransportDispatch, self).setUp()
     memory_server = MemoryServer()
     memory_server.start_server()
     self.base_transport = get_transport(memory_server.get_url())
     self.factory = BranchTransportDispatch(self.base_transport)
 def _setUpMemoryServer(self):
     memory_server = MemoryServer()
     memory_server.start_server()
     self.addCleanup(memory_server.stop_server)
     return memory_server
 def setUp(self):
     super(TestBranchTransportDispatch, self).setUp()
     memory_server = MemoryServer()
     memory_server.start_server()
     self.base_transport = get_transport(memory_server.get_url())
     self.factory = BranchTransportDispatch(self.base_transport)
示例#10
0
 def _setUpMemoryServer(self):
     memory_server = MemoryServer()
     memory_server.start_server()
     self.addCleanup(memory_server.stop_server)
     return memory_server