~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-10-10 01:05:01 UTC
  • mfrom: (2872.5.5 129701-readonly-commit)
  • Revision ID: pqm@pqm.ubuntu.com-20071010010501-ejbj03m5w3k9vdsd
Avoid internal error tracebacks on failure to lock on readonly transport (#129701)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib import (
22
22
    bzrdir,
23
23
    errors,
 
24
    symbol_versioning,
24
25
    )
25
26
from bzrlib.tests import TestCase, TestCaseWithTransport
26
27
 
27
28
 
28
 
# TODO: Make sure builtin exception class formats are consistent - e.g. should
29
 
# or shouldn't end with a full stop, etc.
30
 
 
31
29
 
32
30
class TestErrors(TestCaseWithTransport):
33
31
 
142
140
            str(error))
143
141
 
144
142
    def test_read_only_lock_error(self):
145
 
        error = errors.ReadOnlyLockError('filename', 'error message')
 
143
        error = self.applyDeprecated(symbol_versioning.zero_ninetytwo,
 
144
            errors.ReadOnlyLockError, 'filename', 'error message')
146
145
        self.assertEqualDiff("Cannot acquire write lock on filename."
147
146
                             " error message", str(error))
148
147
 
 
148
    def test_lock_failed(self):
 
149
        error = errors.LockFailed('http://canonical.com/', 'readonly transport')
 
150
        self.assertEqualDiff("Cannot lock http://canonical.com/: readonly transport",
 
151
            str(error))
 
152
        self.assertFalse(error.internal_error)
 
153
 
149
154
    def test_too_many_concurrent_requests(self):
150
155
        error = errors.TooManyConcurrentRequests("a medium")
151
156
        self.assertEqualDiff("The medium 'a medium' has reached its concurrent "