'Test readline() with different sizes.
Args:
size: The size to pass to readline()
chunks: A list of expected chunks to read.'

@pytest.mark.parametrize('size,    chunks', [((-1), ['one\n', 'two\n', 'three', '']), (0, ['', '', '', '']), (2, ['on', 'e\n', 'tw', 'o\n', 'th', 're', 'e']), (10, ['one\n', 'two\n', 'three', ''])])
def test_readline(self, size, chunks, pyqiodev):

    with pyqiodev.open(QIODevice.WriteOnly) as f:
        f.write('one\ntwo\nthree')
    pyqiodev.open(QIODevice.ReadOnly)
    for (i, chunk) in enumerate(chunks, start=1):
        print 'Expecting    chunk    {}:    {!r}'.format(i, chunk)
        assert (pyqiodev.readline(size) == chunk)
