~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-15 21:40:03 UTC
  • mto: This revision was merged to the branch mainline in revision 3791.
  • Revision ID: john@arbash-meinel.com-20081015214003-n96hr05ylrwlgdvi
Add Builder.set_optimize(for_size=True) for GraphIndexBuilder and BTreeBuilder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
434
434
        self.assertEqual(sorted(nodes), nodes)
435
435
        self.assertEqual(16, len(nodes))
436
436
 
 
437
    def test_set_optimize(self):
 
438
        builder = btree_index.BTreeBuilder(key_elements=2, reference_lists=2)
 
439
        builder.set_optimize(for_size=True)
 
440
        self.assertTrue(builder._optimize_for_size)
 
441
        builder.set_optimize(for_size=False)
 
442
        self.assertFalse(builder._optimize_for_size)
 
443
 
437
444
    def test_spill_index_stress_2_2(self):
438
445
        # test that references and longer keys don't confuse things.
439
446
        builder = btree_index.BTreeBuilder(key_elements=2, reference_lists=2,