~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

Merge up split out hpss-chroot branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
import bzrlib
24
24
from bzrlib import urlutils
25
 
from bzrlib.errors import (
26
 
    ConnectionError,
27
 
    DependencyNotPresent,
28
 
    FileExists,
29
 
    InvalidURLJoin,
30
 
    NoSuchFile,
31
 
    PathNotChild,
32
 
    TransportNotPossible,
33
 
    UnsupportedProtocol,
34
 
    )
 
25
from bzrlib.errors import (ConnectionError,
 
26
                           DependencyNotPresent,
 
27
                           FileExists,
 
28
                           InvalidURLJoin,
 
29
                           NoSuchFile,
 
30
                           PathNotChild,
 
31
                           TransportNotPossible,
 
32
                           UnsupportedProtocol,
 
33
                           )
35
34
from bzrlib.tests import TestCase, TestCaseInTempDir
36
35
from bzrlib.transport import (_CoalescedOffset,
37
36
                              _get_protocol_handlers,
72
71
            _set_protocol_handlers(my_handlers)
73
72
            register_lazy_transport('foo', 'bzrlib.tests.test_transport', 'TestTransport.SampleHandler')
74
73
            register_lazy_transport('bar', 'bzrlib.tests.test_transport', 'TestTransport.SampleHandler')
75
 
            self.assertEqual([SampleHandler.__module__],
 
74
            self.assertEqual([SampleHandler.__module__, 'bzrlib.transport.chroot'],
76
75
                             _get_transport_modules())
77
76
        finally:
78
77
            _set_protocol_handlers(handlers)
379
378
        server.tearDown()
380
379
 
381
380
 
382
 
class FakeTransport(object):
383
 
    # XXX: FakeTransport copied from test_wsgi.py
384
 
 
385
 
    def __init__(self):
386
 
        self.calls = []
387
 
        self.base = 'fake:///'
388
 
 
389
 
    def abspath(self, relpath):
390
 
        return 'fake:///' + relpath
391
 
 
392
 
    def clone(self, relpath):
393
 
        self.calls.append(('clone', relpath))
394
 
        return self
395
 
 
396
 
 
397
381
class ReadonlyDecoratorTransportTest(TestCase):
398
382
    """Readonly decoration specific tests."""
399
383