+ modes = [("start_on_segment_boundary",
+ mathutil.next_multiple(128 * 1024, 3), 50),
+ ("ending_one_byte_after_segment_boundary",
+ mathutil.next_multiple(128 * 1024, 3)-50, 51),
+ ("zero_length_at_start", 0, 0),
+ ("zero_length_in_middle", 50, 0),
+ ("zero_length_at_segment_boundary",
+ mathutil.next_multiple(128 * 1024, 3), 0),
+ ]
+ for (name, offset, length) in modes:
+ d.addCallback(self._do_partial_read, name, offset, length)
+ # then read only a few bytes at a time, and see that the results are
+ # what we expect.