mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
tests/extmod/btree1: Tests against in-memory DB (using io.BytesIO).
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user