~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_groupcompress.py

Test that the record stream has the correct values set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
553
553
                    'as-requested', False)]
554
554
        self.assertEqual([('b',), ('a',), ('d',), ('c',)], keys)
555
555
 
 
556
    def test_get_record_stream_max_entries_per_source_default(self):
 
557
        vf = self.make_test_vf(True, dir='source')
 
558
        vf.add_lines(('a',), (), ['lines\n'])
 
559
        vf.writer.end()
 
560
        record = vf.get_record_stream([('a',)], 'unordered', True).next()
 
561
        self.assertEqual(vf._DEFAULT_MAX_ENTRIES_PER_SOURCE,
 
562
                         record._manager._get_max_entries_per_source())
 
563
 
 
564
    def test_get_record_stream_accesses_max_entries_per_source_default(self):
 
565
        vf = self.make_test_vf(True, dir='source')
 
566
        vf.add_lines(('a',), (), ['lines\n'])
 
567
        vf.writer.end()
 
568
        vf._max_entries_per_source = 1234
 
569
        record = vf.get_record_stream([('a',)], 'unordered', True).next()
 
570
        self.assertEqual(1234, record._manager._get_max_entries_per_source())
 
571
 
 
572
 
556
573
    def test_insert_record_stream_reuses_blocks(self):
557
574
        vf = self.make_test_vf(True, dir='source')
558
575
        def grouped_stream(revision_ids, first_parents=()):