def test_size(self): data = default_block_size * 2 * '.' self.assert_equal(['....'], list(gen_fragments(stringio(data), 4))) expected = [ default_block_size * '.', '..' ] actual = list(gen_fragments(stringio(data), default_block_size + 2)) assert expected == actual
def test_nosize(self): block = default_block_size * '.' data = block + block actual = list(gen_fragments(stringio(data))) assert [block, block] == actual data = block + '...' actual = list(gen_fragments(stringio(data))) assert [block, '...'] == actual