70
71
self.assertEqual(True, transport.listable())
71
72
self.assertEqual(False, transport.should_cache())
72
73
self.assertEqual(False, transport.is_readonly())
76
class ReadonlyDecoratorTransportTest(TestCase):
77
"""Readonly decoration specific tests."""
79
def test_local_parameters(self):
80
import bzrlib.transport.readonly as readonly
81
# connect to . in readonly mode
82
transport = readonly.ReadonlyTransportDecorator('readonly+.')
83
self.assertEqual(True, transport.listable())
84
self.assertEqual(False, transport.should_cache())
85
self.assertEqual(True, transport.is_readonly())
87
def test_http_parameters(self):
88
import bzrlib.transport.readonly as readonly
89
from bzrlib.transport.http import HttpServer
90
# connect to . via http which is not listable
94
transport = get_transport('readonly+' + server.get_url())
95
self.failUnless(isinstance(transport,
96
readonly.ReadonlyTransportDecorator))
97
self.assertEqual(False, transport.listable())
98
self.assertEqual(True, transport.should_cache())
99
self.assertEqual(True, transport.is_readonly())