Message78599
Thanks for the new implementation of MockNonBlockWriterIO class. It
makes tests so much easier to read.
There are some minor things in your patch that I would change. For example:
# 1 byte will be written, the rest will be buffered
raw.block_on(b"k")
self.assertEquals(bufio.write(b"jklmn"), 5)
# ...
raw.block_on(b"0")
The comment is misleading because in fact no byte is written at raw
level. That's because the data size is smaller than the buffer size and
the buffer is empty (was emptied by the last write call). All this
renders raw.block_on(b"k") call useless. I also think this is the
correct behavior regardless of implementation language of BufferedWriter
class i.e. no write call should write at raw level smaller chunks of
data than buffer's size unless it has to.
Your tests can't cover the pre-flush condition because max_buffer_size
equals buffer_size.
Unless you'll beat me to it or prove me wrong, I'll update your patch
next year. |
|
Date |
User |
Action |
Args |
2008-12-31 12:12:52 | severb | set | recipients:
+ severb, amaury.forgeotdarc, pitrou, christian.heimes |
2008-12-31 12:12:52 | severb | set | messageid: <1230725572.69.0.11100419582.issue4263@psf.upfronthosting.co.za> |
2008-12-31 12:12:51 | severb | link | issue4263 messages |
2008-12-31 12:12:50 | severb | create | |
|