Commit 090a1e01 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5edc9d06
......@@ -216,6 +216,9 @@ def StructureOf(znode):
# Restructure reorganizes ZODB BTree instance (not Tree) according to specified
# topology structure.
#
# NOTE ZODB BTree package does not tolerate structures with empty BTree nodes
# except for the single case of empty tree.
def Restructure(ztree, newStructure):
_ = _zclassify(ztree)
assert _.is_ztree
......
......@@ -344,8 +344,23 @@ def test_allStructs():
# T4/
# nothing - rightmost bucket is always empty
]
# XXX Y tests for maxsplit=2 / maxdepth=2 ?
# (if yes -> compare with set, not exact order, and use topoencoding on the right)
def TY(keys, maxdepth, maxsplit):
yv = Y(keys, maxdepth, maxsplit)
return list([xbtree.TopoEncode(_) for _ in yv])
assert TY([1,3], 1, 1) == [
'T/B1,3',
'T/T/B1,3',
'T/T2/B1-B3',
'T/T3/B1-B3',
'T2/B1-B3',
'T2/T-T/B1-B3',
'T3/B1-B3',
'T3/T-T/B1-B3',
]
# XBlk simulates ZBlk without xbtree_test.py depending on file_zodb.py
......
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