/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Martin Pool
  • Date: 2008-05-27 03:00:53 UTC
  • mfrom: (3452 +trunk)
  • mto: (3724.1.1 lock-hooks)
  • mto: This revision was merged to the branch mainline in revision 3730.
  • Revision ID: mbp@sourcefrog.net-20080527030053-0mct6dypek0ysjc3
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
                             " tree atree.", str(error))
176
176
        self.assertIsInstance(error, errors.NoSuchRevision)
177
177
 
 
178
    def test_not_stacked(self):
 
179
        error = errors.NotStacked('a branch')
 
180
        self.assertEqualDiff("The branch 'a branch' is not stacked.",
 
181
            str(error))
 
182
 
178
183
    def test_not_write_locked(self):
179
184
        error = errors.NotWriteLocked('a thing to repr')
180
185
        self.assertEqualDiff("'a thing to repr' is not write locked but needs "
181
186
            "to be.",
182
187
            str(error))
183
188
 
184
 
    def test_read_only_lock_error(self):
185
 
        error = self.applyDeprecated(symbol_versioning.zero_ninetytwo,
186
 
            errors.ReadOnlyLockError, 'filename', 'error message')
187
 
        self.assertEqualDiff("Cannot acquire write lock on filename."
188
 
                             " error message", str(error))
189
 
 
190
189
    def test_lock_failed(self):
191
190
        error = errors.LockFailed('http://canonical.com/', 'readonly transport')
192
191
        self.assertEqualDiff("Cannot lock http://canonical.com/: readonly transport",
200
199
            "the currently open request.",
201
200
            str(error))
202
201
 
 
202
    def test_unavailable_representation(self):
 
203
        error = errors.UnavailableRepresentation(('key',), "mpdiff", "fulltext")
 
204
        self.assertEqualDiff("The encoding 'mpdiff' is not available for key "
 
205
            "('key',) which is encoded as 'fulltext'.",
 
206
            str(error))
 
207
 
203
208
    def test_unknown_hook(self):
204
209
        error = errors.UnknownHook("branch", "foo")
205
210
        self.assertEqualDiff("The branch hook 'foo' is unknown in this version"
210
215
            " of bzrlib.",
211
216
            str(error))
212
217
 
 
218
    def test_unstackable_branch_format(self):
 
219
        format = u'foo'
 
220
        url = "/foo"
 
221
        error = errors.UnstackableBranchFormat(format, url)
 
222
        self.assertEqualDiff(
 
223
            "The branch '/foo'(foo) is not a stackable format. "
 
224
            "You will need to upgrade the branch to permit branch stacking.",
 
225
            str(error))
 
226
 
 
227
    def test_unstackable_repository_format(self):
 
228
        format = u'foo'
 
229
        url = "/foo"
 
230
        error = errors.UnstackableRepositoryFormat(format, url)
 
231
        self.assertEqualDiff(
 
232
            "The repository '/foo'(foo) is not a stackable format. "
 
233
            "You will need to upgrade the repository to permit branch stacking.",
 
234
            str(error))
 
235
 
213
236
    def test_up_to_date(self):
214
237
        error = errors.UpToDateFormat(bzrdir.BzrDirFormat4())
215
238
        self.assertEqualDiff("The branch format Bazaar-NG branch, "