/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: John Arbash Meinel
  • Date: 2008-06-16 17:11:49 UTC
  • mfrom: (3496 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3497.
  • Revision ID: john@arbash-meinel.com-20080616171149-q4cryeayazevsjlk
merge dev, resolve

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        self.assertEqualDiff('The prefix foo is in the help search path twice.',
53
53
            str(error))
54
54
 
 
55
    def test_ghost_revisions_have_no_revno(self):
 
56
        error = errors.GhostRevisionsHaveNoRevno('target', 'ghost_rev')
 
57
        self.assertEqualDiff("Could not determine revno for {target} because"
 
58
                             " its ancestry shows a ghost at {ghost_rev}",
 
59
                             str(error))
 
60
 
55
61
    def test_incompatibleAPI(self):
56
62
        error = errors.IncompatibleAPI("module", (1, 2, 3), (4, 5, 6), (7, 8, 9))
57
63
        self.assertEqualDiff(
175
181
                             " tree atree.", str(error))
176
182
        self.assertIsInstance(error, errors.NoSuchRevision)
177
183
 
 
184
    def test_not_stacked(self):
 
185
        error = errors.NotStacked('a branch')
 
186
        self.assertEqualDiff("The branch 'a branch' is not stacked.",
 
187
            str(error))
 
188
 
178
189
    def test_not_write_locked(self):
179
190
        error = errors.NotWriteLocked('a thing to repr')
180
191
        self.assertEqualDiff("'a thing to repr' is not write locked but needs "
181
192
            "to be.",
182
193
            str(error))
183
194
 
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
195
    def test_lock_failed(self):
191
196
        error = errors.LockFailed('http://canonical.com/', 'readonly transport')
192
197
        self.assertEqualDiff("Cannot lock http://canonical.com/: readonly transport",
200
205
            "the currently open request.",
201
206
            str(error))
202
207
 
 
208
    def test_unavailable_representation(self):
 
209
        error = errors.UnavailableRepresentation(('key',), "mpdiff", "fulltext")
 
210
        self.assertEqualDiff("The encoding 'mpdiff' is not available for key "
 
211
            "('key',) which is encoded as 'fulltext'.",
 
212
            str(error))
 
213
 
203
214
    def test_unknown_hook(self):
204
215
        error = errors.UnknownHook("branch", "foo")
205
216
        self.assertEqualDiff("The branch hook 'foo' is unknown in this version"
210
221
            " of bzrlib.",
211
222
            str(error))
212
223
 
 
224
    def test_unstackable_branch_format(self):
 
225
        format = u'foo'
 
226
        url = "/foo"
 
227
        error = errors.UnstackableBranchFormat(format, url)
 
228
        self.assertEqualDiff(
 
229
            "The branch '/foo'(foo) is not a stackable format. "
 
230
            "You will need to upgrade the branch to permit branch stacking.",
 
231
            str(error))
 
232
 
 
233
    def test_unstackable_repository_format(self):
 
234
        format = u'foo'
 
235
        url = "/foo"
 
236
        error = errors.UnstackableRepositoryFormat(format, url)
 
237
        self.assertEqualDiff(
 
238
            "The repository '/foo'(foo) is not a stackable format. "
 
239
            "You will need to upgrade the repository to permit branch stacking.",
 
240
            str(error))
 
241
 
213
242
    def test_up_to_date(self):
214
243
        error = errors.UpToDateFormat(bzrdir.BzrDirFormat4())
215
244
        self.assertEqualDiff("The branch format Bazaar-NG branch, "
446
475
            "Unable to create symlink u'\\xb5' on this platform",
447
476
            str(err))
448
477
 
 
478
    def test_invalid_url_join(self):
 
479
        """Test the formatting of InvalidURLJoin."""
 
480
        e = errors.InvalidURLJoin('Reason', 'base path', ('args',))
 
481
        self.assertEqual(
 
482
            "Invalid URL join request: Reason: 'base path' + ('args',)",
 
483
            str(e))
 
484
 
449
485
    def test_incorrect_url(self):
450
486
        err = errors.InvalidBugTrackerURL('foo', 'http://bug.com/')
451
487
        self.assertEquals(