~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-05 00:34:00 UTC
  • mfrom: (2052.6.5 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070705003400-d5p03g67nxpohfox
(robertc) Make read() errors on directories raise ReadError not IO errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
                             repo.bzrdir.root_transport.base,
167
167
                             str(error))
168
168
 
 
169
    def test_read_error(self):
 
170
        # a unicode path to check that %r is being used.
 
171
        path = u'a path'
 
172
        error = errors.ReadError(path)
 
173
        self.assertEqualDiff("Error reading from u'a path'.", str(error))
 
174
 
 
175
 
169
176
    def test_bzrnewerror_is_deprecated(self):
170
177
        class DeprecatedError(errors.BzrNewError):
171
178
            pass
205
212
            str(error))
206
213
 
207
214
    def test_transport_not_possible(self):
208
 
        e = errors.TransportNotPossible('readonly', 'original error')
209
 
        self.assertEqual('Transport operation not possible:'
210
 
                         ' readonly original error', str(e))
 
215
        error = errors.TransportNotPossible('readonly', 'original error')
 
216
        self.assertEqualDiff('Transport operation not possible:'
 
217
                         ' readonly original error', str(error))
211
218
 
212
219
    def assertSocketConnectionError(self, expected, *args, **kwargs):
213
220
        """Check the formatting of a SocketConnectionError exception"""
360
367
        e = ErrorWithBadFormat(not_thing='x')
361
368
        self.assertStartsWith(
362
369
            str(e), 'Unprintable exception ErrorWithBadFormat')
363