~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-09-03 15:04:54 UTC
  • mfrom: (4667.1.2 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090903150454-mm3xdxw6jq6mml5l
(jam) Minor test suite speedup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
681
681
        self.assertFalse(repo._format.supports_external_lookups)
682
682
 
683
683
 
684
 
class Test2a(TestCaseWithTransport):
 
684
class Test2a(tests.TestCaseWithMemoryTransport):
685
685
 
686
686
    def test_format_pack_compresses_True(self):
687
687
        repo = self.make_repository('repo', format='2a')
688
688
        self.assertTrue(repo._format.pack_compresses)
689
689
 
690
690
    def test_inventories_use_chk_map_with_parent_base_dict(self):
691
 
        tree = self.make_branch_and_tree('repo', format="2a")
 
691
        tree = self.make_branch_and_memory_tree('repo', format="2a")
 
692
        tree.lock_write()
 
693
        tree.add([''], ['TREE_ROOT'])
692
694
        revid = tree.commit("foo")
 
695
        tree.unlock()
693
696
        tree.lock_read()
694
697
        self.addCleanup(tree.unlock)
695
698
        inv = tree.branch.repository.get_inventory(revid)
704
707
        # at 20 unchanged commits, chk pages are packed that are split into
705
708
        # two groups such that the new pack being made doesn't have all its
706
709
        # pages in the source packs (though they are in the repository).
707
 
        tree = self.make_branch_and_tree('tree', format='2a')
 
710
        # Use a memory backed repository, we don't need to hit disk for this
 
711
        tree = self.make_branch_and_memory_tree('tree', format='2a')
 
712
        tree.lock_write()
 
713
        self.addCleanup(tree.unlock)
 
714
        tree.add([''], ['TREE_ROOT'])
708
715
        for pos in range(20):
709
716
            tree.commit(str(pos))
710
717
 
711
718
    def test_pack_with_hint(self):
712
 
        tree = self.make_branch_and_tree('tree', format='2a')
 
719
        tree = self.make_branch_and_memory_tree('tree', format='2a')
 
720
        tree.lock_write()
 
721
        self.addCleanup(tree.unlock)
 
722
        tree.add([''], ['TREE_ROOT'])
713
723
        # 1 commit to leave untouched
714
724
        tree.commit('1')
715
725
        to_keep = tree.branch.repository._pack_collection.names()