~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

Get a working chk_map using inventory implementation bootstrapped.

Show diffs side-by-side

added added

removed removed

Lines of Context:
657
657
        self.assertFalse(repo._format.supports_external_lookups)
658
658
 
659
659
 
 
660
class TestDevelopment3(TestCaseWithTransport):
 
661
 
 
662
    def test_add_inventory_uses_chk_map(self):
 
663
        repo = self.make_repository('repo', format="development3")
 
664
        source = self.make_branch_and_tree("source", format="pack-0.92")
 
665
        revid = source.commit("foo", rev_id="foo")
 
666
        # get the inventory from the committed revision
 
667
        basis = source.basis_tree()
 
668
        basis.lock_read()
 
669
        self.addCleanup(basis.unlock)
 
670
        inv = basis.inventory
 
671
        repo.lock_write()
 
672
        self.addCleanup(repo.unlock)
 
673
        repo.start_write_group()
 
674
        self.addCleanup(repo.abort_write_group)
 
675
        repo.add_inventory(revid, inv, [])
 
676
        self.assertEqual(set([(revid,)]), repo.inventories.keys())
 
677
        self.assertEqual(
 
678
            set([('sha1:a521a815c343d72dffac50e316246f1fade1a4d3',),
 
679
                ('sha1:a12ffb3c1810005e8ed9388d29602e1e9e8e06ac',)]),
 
680
            repo.chk_bytes.keys())
 
681
 
 
682
 
660
683
class TestWithBrokenRepo(TestCaseWithTransport):
661
684
    """These tests seem to be more appropriate as interface tests?"""
662
685