~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_chunk_writer.py

  • Committer: John Arbash Meinel
  • Date: 2008-08-22 03:58:19 UTC
  • mto: This revision was merged to the branch mainline in revision 3653.
  • Revision ID: john@arbash-meinel.com-20080822035819-yx19e7qxdvjgaeql
Update the stats for the current code layout.
This shows why I like _max_repack=2 so much. It is
the highest value that has 'no waste'.
At _max_repack=2, you can always sneak in 1 more
line, which avoids triggering an extra repack.
Also, updating the timings with the current tuning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
            # Create a line with this group
79
79
            lines.append(''.join(map(str, numbers)) + '\n')
80
80
        writer = chunk_writer.ChunkWriter(4096, 256)
81
 
        for line in lines:
 
81
        for idx, line in enumerate(lines):
82
82
            if writer.write(line):
 
83
                self.assertEqual(44, idx)
83
84
                break
 
85
        else:
 
86
            self.fail('We were able to write all lines')
84
87
        self.assertFalse(writer.write("A"*256, reserved=True))
85
88
        bytes_list, unused, _ = writer.finish()
86
89
        node_bytes = self.check_chunk(bytes_list, 4096)