108
108
# restore original values
109
109
_set_protocol_handlers(saved_handlers)
111
111
def test_transport_fallback(self):
112
112
"""Transport with missing dependency causes no error"""
113
113
saved_handlers = _get_protocol_handlers()
381
381
self.assertEqual(server, relpath_cloned.server)
382
382
self.assertEqual(server, abspath_cloned.server)
383
383
server.tearDown()
385
385
def test_chroot_url_preserves_chroot(self):
386
386
"""Calling get_transport on a chroot transport's base should produce a
387
387
transport with exactly the same behaviour as the original chroot
399
399
self.assertEqual(transport.server, new_transport.server)
400
400
self.assertEqual(transport.base, new_transport.base)
401
401
server.tearDown()
403
403
def test_urljoin_preserves_chroot(self):
404
404
"""Using urlutils.join(url, '..') on a chroot URL should not produce a
405
405
URL that escapes the intended chroot.
565
565
class TestTransportImplementation(TestCaseInTempDir):
566
566
"""Implementation verification for transports.
568
568
To verify a transport we need a server factory, which is a callable
569
569
that accepts no parameters and returns an implementation of
570
570
bzrlib.transport.Server.
572
572
That Server is then used to construct transport instances and test
573
573
the transport via loopback activity.
575
Currently this assumes that the Transport object is connected to the
576
current working directory. So that whatever is done
577
through the transport, should show up in the working
575
Currently this assumes that the Transport object is connected to the
576
current working directory. So that whatever is done
577
through the transport, should show up in the working
578
578
directory, and vice-versa. This is a bug, because its possible to have
579
URL schemes which provide access to something that may not be
580
result in storage on the local disk, i.e. due to file system limits, or
579
URL schemes which provide access to something that may not be
580
result in storage on the local disk, i.e. due to file system limits, or
581
581
due to it being a database or some other non-filesystem tool.
583
583
This also tests to make sure that the functions work with both
584
584
generators and lists (assuming iter(list) is effectively a generator)
588
588
super(TestTransportImplementation, self).setUp()
589
589
self._server = self.transport_server()