85
86
self.assertEqual(True, transport.listable())
86
87
self.assertEqual(False, transport.should_cache())
87
88
self.assertEqual(False, transport.is_readonly())
91
class ReadonlyDecoratorTransportTest(TestCase):
92
"""Readonly decoration specific tests."""
94
def test_local_parameters(self):
95
import bzrlib.transport.readonly as readonly
96
# connect to . in readonly mode
97
transport = readonly.ReadonlyTransportDecorator('readonly+.')
98
self.assertEqual(True, transport.listable())
99
self.assertEqual(False, transport.should_cache())
100
self.assertEqual(True, transport.is_readonly())
102
def test_http_parameters(self):
103
import bzrlib.transport.readonly as readonly
104
from bzrlib.transport.http import HttpServer
105
# connect to . via http which is not listable
106
server = HttpServer()
109
transport = get_transport('readonly+' + server.get_url())
110
self.failUnless(isinstance(transport,
111
readonly.ReadonlyTransportDecorator))
112
self.assertEqual(False, transport.listable())
113
self.assertEqual(True, transport.should_cache())
114
self.assertEqual(True, transport.is_readonly())