import pytest

from zeroae.rocksdb.c import db as rdb
from zeroae.rocksdb.c import pinnableslice


@pytest.fixture
def db(rocksdb_db, rocksdb_writeoptions):
    rdb.put(rocksdb_db, rocksdb_writeoptions, "key", "value")
    yield rocksdb_db


@pytest.fixture
def slice(db, rocksdb_readoptions):
    rv = rdb.get_pinned(db, rocksdb_readoptions, "key")
    yield rv
    pinnableslice.destroy(rv)


def test_fixture(slice):
    assert slice is not None


def test_value(slice):
    rv = pinnableslice.value(slice)
    assert rv == "value"

dd54826406a8c3ea1c7cef96d81f0e23da6c844a
<mask token>


@pytest.fixture
def slice(db, rocksdb_readoptions):
    rv = rdb.get_pinned(db, rocksdb_readoptions, 'key')
    yield rv
    pinnableslice.destroy(rv)


<mask token>


def test_value(slice):
    rv = pinnableslice.value(slice)
    assert rv == 'value'

<mask token>


@pytest.fixture
def slice(db, rocksdb_readoptions):
    rv = rdb.get_pinned(db, rocksdb_readoptions, 'key')
    yield rv
    pinnableslice.destroy(rv)


def test_fixture(slice):
    assert slice is not None


def test_value(slice):
    rv = pinnableslice.value(slice)
    assert rv == 'value'

<mask token>


@pytest.fixture
def db(rocksdb_db, rocksdb_writeoptions):
    rdb.put(rocksdb_db, rocksdb_writeoptions, 'key', 'value')
    yield rocksdb_db


@pytest.fixture
def slice(db, rocksdb_readoptions):
    rv = rdb.get_pinned(db, rocksdb_readoptions, 'key')
    yield rv
    pinnableslice.destroy(rv)


def test_fixture(slice):
    assert slice is not None


def test_value(slice):
    rv = pinnableslice.value(slice)
    assert rv == 'value'

import pytest
from zeroae.rocksdb.c import db as rdb
from zeroae.rocksdb.c import pinnableslice


@pytest.fixture
def db(rocksdb_db, rocksdb_writeoptions):
    rdb.put(rocksdb_db, rocksdb_writeoptions, 'key', 'value')
    yield rocksdb_db


@pytest.fixture
def slice(db, rocksdb_readoptions):
    rv = rdb.get_pinned(db, rocksdb_readoptions, 'key')
    yield rv
    pinnableslice.destroy(rv)


def test_fixture(slice):
    assert slice is not None


def test_value(slice):
    rv = pinnableslice.value(slice)
    assert rv == 'value'

import pytest

from zeroae.rocksdb.c import db as rdb
from zeroae.rocksdb.c import pinnableslice


@pytest.fixture
def db(rocksdb_db, rocksdb_writeoptions):
    rdb.put(rocksdb_db, rocksdb_writeoptions, "key", "value")
    yield rocksdb_db


@pytest.fixture
def slice(db, rocksdb_readoptions):
    rv = rdb.get_pinned(db, rocksdb_readoptions, "key")
    yield rv
    pinnableslice.destroy(rv)


def test_fixture(slice):
    assert slice is not None


def test_value(slice):
    rv = pinnableslice.value(slice)
    assert rv == "value"
