Commit 89661f8a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c11ae38b
......@@ -532,19 +532,33 @@ def test_restructure():
b1, b3 = kids
assert isinstance(b1, LOBucket)
assert isinstance(b3, LOBucket)
assert crack_bucket(b1) == ([1], [X[1]])
assert crack_bucket(b3) == ([3], [X[3]])
assert b1._p_oid is None
assert b3._p_oid is None
assert crack_bucket(b1) == ([1], [X[1]])
assert crack_bucket(b3) == ([3], [X[3]])
R(z, 'T/B1,3')
# buckets were not yet assigned oid -> collapsed back into T
assert crack_btree(z) == (BTREE_ONE, ((1, X[1], 3, X[3]),), None)
R(z, 'T3/B1-B3')
kind, keys, kids = crack_btree(z)
# XXX here -> btree_one
assert (kind, keys) == (BTREE_NORMAL, [3])
assert len(kids) == 2
b1, b3 = kids
assert isinstance(b1, LOBucket)
assert isinstance(b3, LOBucket)
assert b1._p_oid is None
assert b3._p_oid is None
assert crack_bucket(b1) == ([1], [X[1]])
assert crack_bucket(b3) == ([3], [X[3]])
transaction.commit() # force buckets to be assigned oid
assert b1._p_oid is not None
assert b3._p_oid is not None
# XXX -> after commit
# restructure back - buckets not collapsed back into T
R(z, 'T/B1,3')
kind, keys, kids = crack_btree(z)
assert (kind, keys) == (BTREE_NORMAL, [])
assert len(kids) == 1
b13 = kids[0]
......
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