def test_chained_readable_readline(): reader = ChainedReadable( BytesIO(b'a'), BytesIO(b'b\nc') ) assert reader.readline(10) == b'ab\n'
def test_chained_readable_exhausted(): reader = ChainedReadable(BytesIO()) assert reader.readline() == b'' assert reader.readline() == b''
def test_chained_readable(): reader = ChainedReadable( BytesIO(b'a'), BytesIO(b'b') ) assert reader.read(3) == b'ab'
def test_chained_readable_readline(): reader = ChainedReadable(BytesIO(b'a'), BytesIO(b'b\nc')) assert reader.readline(10) == b'ab\n'
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'
def test_chained_readable(): reader = ChainedReadable(BytesIO(b'a'), BytesIO(b'b')) assert reader.read(3) == b'ab'