Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
6722f6b6
Commit
6722f6b6
authored
May 18, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f6de3d63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
46 deletions
+0
-46
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+0
-46
No files found.
wcfs/internal/xbtree_test.py
View file @
6722f6b6
...
...
@@ -566,44 +566,20 @@ def test_restructure():
assert
crack_btree
(
z
)
==
(
BTREE_ONE
,
((
1
,
X
[
1
],
3
,
X
[
3
]),),
None
)
R
(
z
,
'T2/B1-B3'
)
b1
,
b3
=
assertT
(
z
,
[
2
],
'B'
,
'B'
)
"""
kind, keys, kids = crack_btree(z)
assert (kind, keys) == (BTREE_NORMAL, [2])
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
assertB
(
b1
,
1
)
assertB
(
b3
,
3
)
"""
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'
)
b1
,
b3
=
assertT
(
z
,
[
3
],
'B'
,
'B'
)
"""
kind, keys, kids = crack_btree(z)
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
assertB
(
b1
,
1
)
assertB
(
b3
,
3
)
"""
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
...
...
@@ -612,18 +588,7 @@ def test_restructure():
# restructure back - buckets not collapsed back into T
R
(
z
,
'T/B1,3'
)
b13
,
=
assertT
(
z
,
[],
'B'
)
"""
kind, keys, kids = crack_btree(z)
assert (kind, keys) == (BTREE_NORMAL, [])
assert len(kids) == 1
b13 = kids[0]
assert b13 is b1
assert isinstance(b13, LOBucket)
"""
assertB
(
b13
,
1
,
3
)
"""
assert crack_bucket(b13) == ([1,3], [X[1], X[3]])
"""
# add 1 key -> B splits -> B + B
...
...
@@ -631,19 +596,8 @@ def test_restructure():
z
[
5
]
=
X
[
5
]
assert
S
(
z
)
==
'T3/B1-B3,5'
b1
,
b35
=
assertT
(
z
,
[
3
],
'B'
,
'B'
)
"""
kind, keys, kids = crack_btree(z)
assert (kind, keys) == (BTREE_NORMAL, [3])
b1, b35 = kids
assert isinstance(b1, LOBucket)
assert isinstance(b35, LOBucket)
"""
assertB
(
b1
,
1
)
assertB
(
b35
,
3
,
5
)
"""
assert crack_bucket(b1) == ([1], [X[1]])
assert crack_bucket(b35) == ([3,5], [X[3], X[5]])
"""
# -> T2/T-T/B1-B3,5 (add intermediate T-T level)
R
(
z
,
'T2/T-T/B1-B3,5'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment