Commit 63eb1d96 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent fb56193f
......@@ -439,11 +439,9 @@ def test_restructure():
db = DB(zstor)
zconn = db.open()
N = 10 # maxkey
X = [] # X[i] -> XBlk corresponding to block #i
for i in range(N):
X.append(XBlk('abcdefghij'[i]))
for i in range(12):
X.append(XBlk('abcdefghijkl'[i]))
# assertB wraps global assertB to automatically fill in X[k] values for specified keys.
def assertB(znode, *keyv):
......@@ -681,6 +679,11 @@ def test_restructure():
R(z, 'T2/T1-T3/B0-B1-T-T/B2-B3')
R(z, 'T2/T1-T/T-T-B2,3/B0-B1')
# degenerate topology from ZODB example
z = Z(1,3,5,7,11)
R(z, 'T4/T2-T/T-T-T6,10/B1-B3-T-T-T/T-B7-B11/B5')
R(z, 'T/B1,3,5,7,11')
# ---- tests on automatically generated topologies ----
#
......@@ -688,11 +691,11 @@ def test_restructure():
# after restructure a tree remains valid without any error introduced )
for nkeys in range(5): # XXX ↑
for xkeyv in xbtree._iterSplitByN(-1, N, nkeys):
for xkeyv in xbtree._iterSplitByN(-1, 5+1, nkeys):
keyv = xkeyv[1:-1] # -1, ..., N -> ...
print(keyv)
z = Z(*keyv)
for tree in xbtree.AllStructs(keyv, 2, 1): # XXX maxsplit -> 2?
for tree in xbtree.AllStructs(keyv, 3, 2):
#print('\t%s' % xbtree.TopoEncode(tree))
R(z, tree)
......
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