Example #1
0
def test_chained_readable_readline():
    reader = ChainedReadable(
        BytesIO(b'a'),
        BytesIO(b'b\nc')
    )
    assert reader.readline(10) == b'ab\n'
Example #2
0
def test_chained_readable_exhausted():
    reader = ChainedReadable(BytesIO())
    assert reader.readline() == b''
    assert reader.readline() == b''
Example #3
0
def test_chained_readable():
    reader = ChainedReadable(
        BytesIO(b'a'),
        BytesIO(b'b')
    )
    assert reader.read(3) == b'ab'
Example #4
0
def test_chained_readable_exhausted():
    reader = ChainedReadable(BytesIO())
    assert reader.readline() == b''
    assert reader.readline() == b''
Example #5
0
def test_chained_readable_readline():
    reader = ChainedReadable(BytesIO(b'a'), BytesIO(b'b\nc'))
    assert reader.readline(10) == b'ab\n'
Example #6
0
def test_chained_readable_is_pickleable():
    reader = ChainedReadable(BytesIO(b'a'), BytesIO(b'b'))
    reader2 = pickle.loads(pickle.dumps(reader))
    assert reader2.read(3) == b'ab'
Example #7
0
def test_chained_readable():
    reader = ChainedReadable(BytesIO(b'a'), BytesIO(b'b'))
    assert reader.read(3) == b'ab'