~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_groupcompress.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-23 01:55:37 UTC
  • mfrom: (4300.1.7 groupcompress_info)
  • Revision ID: pqm@pqm.ubuntu.com-20090423015537-xfgqsbjj9ctpcd3o
(jam) Tweaks to the pure-python group compressor,
        shrinks time from 30min => 4min for some circumstances.

Show diffs side-by-side

added added

removed removed

Lines of Context:
447
447
        # And the decompressor is finalized
448
448
        self.assertIs(None, block._z_content_decompressor)
449
449
 
 
450
    def test__dump(self):
 
451
        dup_content = 'some duplicate content\nwhich is sufficiently long\n'
 
452
        key_to_text = {('1',): dup_content + '1 unique\n',
 
453
                       ('2',): dup_content + '2 extra special\n'}
 
454
        locs, block = self.make_block(key_to_text)
 
455
        self.assertEqual([('f', len(key_to_text[('1',)])),
 
456
                          ('d', 21, len(key_to_text[('2',)]),
 
457
                           [('c', 2, len(dup_content)),
 
458
                            ('i', len('2 extra special\n'), '')
 
459
                           ]),
 
460
                         ], block._dump())
 
461
 
450
462
 
451
463
class TestCaseWithGroupCompressVersionedFiles(tests.TestCaseWithTransport):
452
464