예제 #1
0
    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
예제 #2
0
    def test_discard_all(self):
        buffer = ByteBuffer()
        buffer.write(b"abcdefghi")

        assert buffer.discard() is None
        assert buffer.read() == b""