Commit f1d41c94 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cc67c882
......@@ -439,11 +439,11 @@ def test_restructure():
db = DB(zstor)
zconn = db.open()
N = 8 # maxkey
N = 10 # maxkey
X = [] # X[i] -> XBlk corresponding to block #i
for i in range(N):
X.append(XBlk('abcdefgh'[i]))
X.append(XBlk('abcdefghij'[i]))
# assertB wraps global assertB to automatically fill in X[k] values for specified keys.
def assertB(znode, *keyv):
......@@ -466,7 +466,6 @@ def test_restructure():
return ztree
# R restructures ztree to have specified new topology.
def R(ztree, newtopo):
# verify ztree consistency
......@@ -485,12 +484,10 @@ def test_restructure():
for (k,v) in items:
assert ztree[k] == v
# S returns topo-encoded structure of ztree
def S(ztree):
return xbtree.TopoEncode(xbtree.StructureOf(ztree))
# Z0 creates new empty tree
def Z0():
z = Z()
......@@ -633,6 +630,13 @@ def test_restructure():
assertB(b135, 1,3,5)
# grow the tree with four more keys (6,7,8,9) till top-level tree node splits
assert S(z) == 'T/B1,3,5'
z[6] = X[6]
assert S(z) == 'T5/B1,3-B5,6'
z[7] = X[7]
assert S(z) == 'T5,6/B1,3-B5-B6,7'
#for nkeys in range(5):
# pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment