~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
                           NoSuchFile,
33
33
                           PathNotChild,
34
34
                           TransportNotPossible,
 
35
                           ConnectionError,
 
36
                           DependencyNotPresent,
 
37
                           ReadError,
35
38
                           UnsupportedProtocol,
36
39
                           )
37
40
from bzrlib.tests import TestCase, TestCaseInTempDir
40
43
                              _set_protocol_handlers,
41
44
                              _get_transport_modules,
42
45
                              get_transport,
 
46
                              LateReadError,
43
47
                              register_lazy_transport,
44
48
                              register_transport_proto,
45
49
                              _clear_protocol_handlers,
117
121
        finally:
118
122
            _set_protocol_handlers(saved_handlers)
119
123
 
 
124
    def test_LateReadError(self):
 
125
        """The LateReadError helper should raise on read()."""
 
126
        a_file = LateReadError('a path')
 
127
        try:
 
128
            a_file.read()
 
129
        except ReadError, error:
 
130
            self.assertEqual('a path', error.path)
 
131
        self.assertRaises(ReadError, a_file.read, 40)
 
132
        a_file.close()
 
133
 
120
134
    def test__combine_paths(self):
121
135
        t = Transport('/')
122
136
        self.assertEqual('/home/sarah/project/foo',