24
24
import bzrlib.bzrdir
25
25
import bzrlib.errors as errors
26
26
from bzrlib.tests import TestCaseInTempDir
27
from bzrlib.tests.test_transport import TestTransportImplementation
27
28
import bzrlib.transport
28
29
from bzrlib.transport.memory import MemoryTransport
29
30
import bzrlib.urlutils
32
# jam 20060615 Originally I thought I should use TestCaseWithTransport
33
# but it turns out that doesn't play well with the transport adapter
34
class TestReadBundleFromURL(TestCaseInTempDir):
33
class TestReadBundleFromURL(TestTransportImplementation):
35
34
"""Test that read_bundle works properly across multiple transports"""
38
super(TestReadBundleFromURL, self).setUp()
39
self._server = self.transport_server()
41
self._transport = None
44
self._transport = None
45
self._server.tearDown()
46
super(TestReadBundleFromURL, self).tearDown()
48
def get_transport(self):
49
"""Return a connected transport to the local directory."""
50
base_url = self._server.get_url()
51
t = bzrlib.transport.get_transport(base_url)
52
if not isinstance(t, self.transport_class):
53
# we want to make sure to construct one particular class, even if
54
# there are several available implementations of this transport;
55
# therefore construct it by hand rather than through the regular
56
# get_transport method
57
t = self.transport_class(base_url)
60
36
def get_url(self, relpath=''):
61
37
return bzrlib.urlutils.join(self._server.get_url(), relpath)