def test_send_chunk(): v = "foobarfoobar" for bs in range(1, len(v) + 2): s = cStringIO.StringIO() writer.send_chunk(s, v, bs, 0, len(v)) assert s.getvalue() == v for start in range(len(v)): for end in range(len(v)): s = cStringIO.StringIO() writer.send_chunk(s, v, bs, start, end) assert s.getvalue() == v[start:end]
def test_send_chunk(): v = "foobarfoobar" for bs in range(1, len(v) + 2): s = StringIO() writer.send_chunk(s, v, bs, 0, len(v)) assert s.getvalue() == v for start in range(len(v)): for end in range(len(v)): s = StringIO() writer.send_chunk(s, v, bs, start, end) assert s.getvalue() == v[start:end]