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