def test_empty(self): buffer = ByteBuffer() assert buffer.empty() is True buffer.write(b"abc") assert buffer.empty() is False buffer.discard() assert buffer.empty() is True
def test_discard_all(self): buffer = ByteBuffer() buffer.write(b"abcdefghi") assert buffer.discard() is None assert buffer.read() == b""