Exemple #1
0
def _zext_supported():
    tmpd = mkdtemp('', 'zext_check.')
    defer(lambda: rmtree(tmpd))
    dbfs = tmpd + '/1.fs'

    stor = FileStorage(dbfs, create=True)
    db = DB(stor)
    conn = db.open()
    root = conn.root()
    root._p_changed = True

    txn = transaction.get()
    txn.setExtendedInfo('a', 'b')
    txn.commit()

    for last_txn in stor.iterator(start=stor.lastTransaction()):
        break
    else:
        assert False, "cannot see details of last transaction"

    assert last_txn.extension == {'a': 'b'}
    return hasattr(last_txn, 'extension_bytes')