/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_btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2009-10-20 04:25:27 UTC
  • mto: This revision was merged to the branch mainline in revision 4758.
  • Revision ID: john@arbash-meinel.com-20091020042527-ehogm27th7o4htt6
Move the note and assertions.

We will assert that the internal node cache doesn't change,
though since it is empty, it isn't asserting much... :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
651
651
        self.assertEqual(1, len(list(index.iter_entries([nodes[30][0]]))))
652
652
        self.assertEqual([1, 4], index._row_lengths)
653
653
        self.assertIsNot(None, index._root_node)
654
 
        # NOTE: we don't want to affect the _internal_node_cache, as we expect
655
 
        #       it will be small, and if we ever do touch this index again, it
656
 
        #       will save round-trips. However, it requires a 3-level tree to
657
 
        #       test this...
658
 
        # self.assertTrue(len(index._internal_node_cache) > 0)
 
654
        internal_node_pre_clear = index._internal_node_cache.keys()
659
655
        self.assertTrue(len(index._leaf_node_cache) > 0)
660
656
        index.clear_cache()
661
657
        # We don't touch _root_node or _internal_node_cache, both should be
662
658
        # small, and can save a round trip or two
663
659
        self.assertIsNot(None, index._root_node)
664
 
        # self.assertTrue(len(index._internal_node_cache) > 0)
 
660
        # NOTE: We don't want to affect the _internal_node_cache, as we expect
 
661
        #       it will be small, and if we ever do touch this index again, it
 
662
        #       will save round-trips.  This assertion isn't very strong,
 
663
        #       becuase without a 3-level index, we don't have any internal
 
664
        #       nodes cached.
 
665
        self.assertEqual(internal_node_pre_clear,
 
666
                         index._internal_node_cache.keys())
665
667
        self.assertEqual(0, len(index._leaf_node_cache))
666
668
 
667
669
    def test_trivial_constructor(self):