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

Functional get_record_stream interface tests covering full interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
370
370
        self.assertEqual({'rev-id-1':(['foo\n', 'bar\n'], sha1sum)}, contents)
371
371
 
372
372
        raw_contents = list(data.read_records_iter_raw(records))
373
 
        self.assertEqual([('rev-id-1', gz_txt)], raw_contents)
 
373
        self.assertEqual([('rev-id-1', gz_txt, sha1sum)], raw_contents)
374
374
 
375
375
    def test_not_enough_lines(self):
376
376
        sha1sum = sha.new('foo\n').hexdigest()
387
387
 
388
388
        # read_records_iter_raw won't detect that sort of mismatch/corruption
389
389
        raw_contents = list(data.read_records_iter_raw(records))
390
 
        self.assertEqual([('rev-id-1', gz_txt)], raw_contents)
 
390
        self.assertEqual([('rev-id-1', gz_txt, sha1sum)], raw_contents)
391
391
 
392
392
    def test_too_many_lines(self):
393
393
        sha1sum = sha.new('foo\nbar\n').hexdigest()
405
405
 
406
406
        # read_records_iter_raw won't detect that sort of mismatch/corruption
407
407
        raw_contents = list(data.read_records_iter_raw(records))
408
 
        self.assertEqual([('rev-id-1', gz_txt)], raw_contents)
 
408
        self.assertEqual([('rev-id-1', gz_txt, sha1sum)], raw_contents)
409
409
 
410
410
    def test_mismatched_version_id(self):
411
411
        sha1sum = sha.new('foo\nbar\n').hexdigest()
1056
1056
        """
1057
1057
        index_memo = knit._index.get_position(version_id)
1058
1058
        record = (version_id, index_memo)
1059
 
        [(_, expected_content)] = list(knit._data.read_records_iter_raw([record]))
 
1059
        [(_, expected_content, _)] = list(knit._data.read_records_iter_raw([record]))
1060
1060
        self.assertEqual(expected_content, candidate_content)
1061
1061
 
1062
1062