Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
BTrees
Commits
b8f7d29f
Commit
b8f7d29f
authored
Nov 18, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coverage for _Tree.
parent
eb161007
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
544 additions
and
6 deletions
+544
-6
BTrees/_base.py
BTrees/_base.py
+10
-6
BTrees/tests/test__base.py
BTrees/tests/test__base.py
+534
-0
No files found.
BTrees/_base.py
View file @
b8f7d29f
...
...
@@ -808,7 +808,7 @@ class _Tree(_Base):
max
=
self
.
_to_key
(
max
)
index
=
self
.
_search
(
max
)
if
index
and
data
[
index
].
child
.
minKey
()
>
max
:
index
-=
1
index
-=
1
#pragma NO COVER no idea how to provoke this
return
data
[
index
].
child
.
maxKey
(
max
)
...
...
@@ -862,6 +862,8 @@ class _Tree(_Base):
next
.
_data
=
data
[
index
:]
first
=
data
[
index
]
del
data
[
index
:]
if
len
(
data
)
==
0
:
self
.
_firstbucket
=
None
# lost our bucket, can't buy no beer
if
isinstance
(
first
.
child
,
self
.
__class__
):
next
.
_firstbucket
=
first
.
child
.
_firstbucket
else
:
...
...
@@ -873,16 +875,18 @@ class _Tree(_Base):
self
.
_p_oid
is
not
None
and
self
.
_p_serial
is
not
None
):
self
.
_p_jar
.
readCurrent
(
self
)
data
=
self
.
_data
if
data
:
index
=
self
.
_search
(
key
)
child
=
data
[
index
].
child
else
:
if
not
data
:
raise
KeyError
(
key
)
index
=
self
.
_search
(
key
)
child
=
data
[
index
].
child
removed_first_bucket
,
value
=
child
.
_del
(
key
)
if
index
and
child
.
size
and
key
==
data
[
index
].
key
:
# fix up the node key, but not for the 0'th one.
if
index
>
0
and
child
.
size
and
key
==
data
[
index
].
key
:
self
.
_p_changed
=
True
data
[
index
].
key
=
child
.
minKey
()
...
...
BTrees/tests/test__base.py
View file @
b8f7d29f
This diff is collapsed.
Click to expand it.
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