Commit 572e2e21 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d71182bb
......@@ -371,7 +371,7 @@ def Restructure(ztree, newStructure):
keys = set()
for _ in zrbucketv: zkeys.update(_.node.keys())
for _ in rbucketv: keys.update(_.node.keyv)
assert set(kv.keys()) == zkeys
assert set(kv.keys()) == zkeys, (set(kv.keys()), zkeys)
if zkeys != keys:
raise ValueError("new keys != old keys\ndiff: %s" % zkeys.symmetric_difference(keys))
......
......@@ -446,6 +446,7 @@ def test_restructure():
assert crack_btree(z) == (BTREE_EMPTY, [], [])
return z
# ---- tests ----
# ø -> T/B
z = Z0()
......@@ -492,9 +493,17 @@ def test_restructure():
assert crack_bucket(kids[0]) == ([], [])
"""
# tree with 1 k->v (not yet committed bucket)
z = Z(1)
assert crack_btree(z) == (BTREE_ONE, ((1, X[1]),), None)
R(z, 'T/B1')
assert crack_btree(z) == (BTREE_ONE, ((1, X[1]),), None)
R(z, 'T/T/B1')
1/0
# tree with one not-yet committed bucket
z = Z(1, 3)
z = Z(1,3)
assert crack_btree(z) == (BTREE_ONE, ((1, X[1], 3, X[3]),), None)
# XXX tree with one committed bucket
......
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