~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/test_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-03-09 06:39:13 UTC
  • mfrom: (1596.2.6 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060309063913-6d8ce700706d0802
Merge knit performance stage 1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
        new_signature = wt.branch.repository.get_signature_text('A')
244
244
        self.assertEqual(old_signature, new_signature)
245
245
 
 
246
    def test_exposed_versioned_files_are_marked_dirty(self):
 
247
        repo = self.make_repository('.')
 
248
        repo.lock_write()
 
249
        inv = repo.get_inventory_weave()
 
250
        repo.unlock()
 
251
        self.assertRaises(errors.OutSideTransaction, inv.add_lines, 'foo', [], [])
 
252
 
246
253
 
247
254
class TestCaseWithComplexRepository(TestCaseWithRepository):
248
255
 
356
363
        inv_weave = repo.get_inventory_weave()
357
364
        self.assertEqual(['ghost'], inv_weave.get_ancestry(['ghost']))
358
365
 
359
 
    def test_corrupt_revision_access_asserts(self):
 
366
    def test_corrupt_revision_access_asserts_if_reported_wrong(self):
360
367
        repo = repository.Repository.open('inventory_with_unnecessary_ghost')
 
368
        reported_wrong = False
 
369
        try:
 
370
            if repo.get_ancestry('ghost') != [None, 'the_ghost', 'ghost']:
 
371
                reported_wrong = True
 
372
        except errors.CorruptRepository:
 
373
            # caught the bad data:
 
374
            return
 
375
        if not reported_wrong:
 
376
            return
361
377
        self.assertRaises(errors.CorruptRepository, repo.get_revision, 'ghost')
362
378
 
363
379
    def test_corrupt_revision_get_revision_reconcile(self):