/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: Andrew Bennetts
  • Date: 2009-11-19 06:28:13 UTC
  • mfrom: (4811 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4812.
  • Revision ID: andrew.bennetts@canonical.com-20091119062813-t6sd6gwbot8nfyze
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
        temp_file = builder.finish()
162
162
        content = temp_file.read()
163
163
        del temp_file
164
 
        self.assertEqual(158, len(content))
 
164
        self.assertEqual(131, len(content))
165
165
        self.assertEqual(
166
166
            "B+Tree Graph Index 2\nnode_ref_lists=0\nkey_elements=1\nlen=5\n"
167
167
            "row_lengths=1\n",
185
185
        temp_file = builder.finish()
186
186
        content = temp_file.read()
187
187
        del temp_file
188
 
        self.assertEqual(264, len(content))
 
188
        self.assertEqual(238, len(content))
189
189
        self.assertEqual(
190
190
            "B+Tree Graph Index 2\nnode_ref_lists=2\nkey_elements=2\nlen=10\n"
191
191
            "row_lengths=1\n",
251
251
        temp_file = builder.finish()
252
252
        content = temp_file.read()
253
253
        del temp_file
254
 
        self.assertEqual(181, len(content))
 
254
        self.assertEqual(155, len(content))
255
255
        self.assertEqual(
256
256
            "B+Tree Graph Index 2\nnode_ref_lists=0\nkey_elements=1\nlen=10\n"
257
257
            "row_lengths=1\n",
718
718
        # The entire index should have been read, as it is one page long.
719
719
        self.assertEqual([('readv', 'index', [(0, size)], False, None)],
720
720
            transport._activity)
721
 
        self.assertEqual(1199, size)
 
721
        self.assertEqual(1173, size)
722
722
 
723
723
    def test__read_nodes_no_size_one_page_reads_once(self):
724
724
        self.make_index(nodes=[(('key',), 'value', ())])
772
772
        # The entire index should have been read linearly.
773
773
        self.assertEqual([('readv', 'index', [(0, size)], False, None)],
774
774
            transport._activity)
775
 
        self.assertEqual(1514, size)
 
775
        self.assertEqual(1488, size)
776
776
 
777
777
    def test_validate_two_pages(self):
778
778
        builder = btree_index.BTreeBuilder(key_elements=2, reference_lists=2)