Ejemplo n.º 1
0
def test_simple_write():
    buff = WriteBuffer(10)
    buff.write_bytes(b'hello ')
    buff.write_bytes(b'world')

    assert buff.value == b'hello world'
    assert buff.length == 11
Ejemplo n.º 2
0
def test_write_clear():
    buff = WriteBuffer(10)
    buff.write_bytes(b'foo')
    buff.clear()

    assert buff.value == b''
    assert buff.capacity == 10
    assert buff.length == 0