~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-10-15 21:27:39 UTC
  • mto: This revision was merged to the branch mainline in revision 3791.
  • Revision ID: john@arbash-meinel.com-20081015212739-ap2uunpg6rjkypc1
Add ChunkWriter.optimize(for_size=True)

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        # Only a zlib header.
40
40
        self.assertEqual(4088, padding)
41
41
 
 
42
    def test_optimize_for_speed(self):
 
43
        writer = chunk_writer.ChunkWriter(4096)
 
44
        writer.optimize(for_size=False)
 
45
        self.assertEqual(chunk_writer.ChunkWriter._repack_opts_for_speed,
 
46
                         (writer._max_repack, writer._max_zsync))
 
47
 
 
48
    def test_optimize_for_size(self):
 
49
        writer = chunk_writer.ChunkWriter(4096)
 
50
        writer.optimize(for_size=True)
 
51
        self.assertEqual(chunk_writer.ChunkWriter._repack_opts_for_size,
 
52
                         (writer._max_repack, writer._max_zsync))
 
53
 
42
54
    def test_some_data(self):
43
55
        writer = chunk_writer.ChunkWriter(4096)
44
56
        writer.write("foo bar baz quux\n")