tests/extmod/btree1: Tests against in-memory DB (using io.BytesIO).

This commit is contained in:
Paul Sokolovsky 2016-07-31 02:29:05 +03:00
parent aac9e8cfa3
commit 617bda27e9

View File

@ -1,11 +1,15 @@
try:
import btree
import uio
except ImportError:
print("SKIP")
import sys
sys.exit()
db = btree.open(None)
#f = open("_test.db", "w+b")
f = uio.BytesIO()
db = btree.open(f)
db[b"foo3"] = b"bar3"
db[b"foo1"] = b"bar1"
db[b"foo2"] = b"bar2"
@ -59,3 +63,4 @@ for k in db:
print(k)
db.close()
f.close()