示例#1
0
def test_set_get(context):
    context.write_full('foo', b'bar')

    with pytest.raises(rados.NoData):
        context.get_xattr('foo', 'a')

    context.set_xattr('foo', 'a', b'b')
    assert b'b' == context.get_xattr('foo', 'a')
示例#2
0
def test_write_attr(context):
    wop = context.write_op_create()
    wop.setxattr('x', b'y')
    wop.write_full(b'bar')
    context.write_op_operate('foo', wop)

    assert b'y' == context.get_xattr('foo', 'x')