#  tests for python-leveldb-0.201-py38h23ab428_0 (this is a generated file);
print('===== testing package: python-leveldb-0.201-py38h23ab428_0 =====');
print('running run_test.py');
#  --- run_test.py (begin) ---
import leveldb

db = leveldb.LevelDB('./db')

# single put
db.Put(b'hello', b'hello world')
print(db.Get(b'hello').decode('utf-8'))

# multiple put/delete applied atomically, and committed to disk
batch = leveldb.WriteBatch()
batch.Put(b'hello', b'world')
batch.Put(b'hello again', b'world')
batch.Delete(b'hello')

db.Write(batch, sync = True)
#  --- run_test.py (end) ---

print('===== python-leveldb-0.201-py38h23ab428_0 OK =====');
print("import: 'leveldb'")
import leveldb

