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

@pytest.mark.parametrize('size,    chunks', [((-1), ['1234567890']), (0, ['']), (3, ['123', '456', '789', '0']), (20, ['1234567890'])])
def test_read(self, size, chunks, pyqiodev):

    with pyqiodev.open(QIODevice.WriteOnly) as f:
        f.write('1234567890')
    pyqiodev.open(QIODevice.ReadOnly)
    for (i, chunk) in enumerate(chunks):
        print 'Expecting    chunk    {}:    {!r}'.format(i, chunk)
        assert (pyqiodev.read(size) == chunk)
