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
f5db3d59
Commit
f5db3d59
authored
Nov 11, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
100% coverage for BTrees.fsBTree.
parent
db4ea45e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
BTrees/tests/test_fsBTree.py
BTrees/tests/test_fsBTree.py
+27
-0
No files found.
BTrees/tests/test_fsBTree.py
View file @
f5db3d59
...
...
@@ -23,6 +23,10 @@ class fsBucketTests(unittest.TestCase):
def
_makeOne
(
self
,
*
args
,
**
kw
):
return
self
.
_getTargetClass
()(
*
args
,
**
kw
)
def
test_MERGE_WEIGHT
(
self
):
bucket
=
self
.
_makeOne
()
self
.
assertEqual
(
bucket
.
MERGE_WEIGHT
(
42
,
17
),
42
)
def
test_toString
(
self
):
bucket
=
self
.
_makeOne
([(
c
*
2
,
c
*
6
)
for
c
in
'abcdef'
])
self
.
assertEqual
(
bucket
.
toString
(),
...
...
@@ -33,6 +37,29 @@ class fsBucketTests(unittest.TestCase):
after
=
before
.
fromString
(
before
.
toString
())
self
.
assertEqual
(
before
.
__getstate__
(),
after
.
__getstate__
())
def
test_fromString_empty
(
self
):
before
=
self
.
_makeOne
([(
c
*
2
,
c
*
6
)
for
c
in
'abcdef'
])
after
=
before
.
fromString
(
''
)
self
.
assertEqual
(
after
.
__getstate__
(),
((),))
def
test_fromString_invalid
(
self
):
bucket
=
self
.
_makeOne
([(
c
*
2
,
c
*
6
)
for
c
in
'abcdef'
])
self
.
assertRaises
(
ValueError
,
bucket
.
fromString
,
'xxx'
)
class
fsBTreeTests
(
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.fsBTree
import
fsBTree
return
fsBTree
def
_makeOne
(
self
,
*
args
,
**
kw
):
return
self
.
_getTargetClass
()(
*
args
,
**
kw
)
def
test_MERGE_WEIGHT
(
self
):
bucket
=
self
.
_makeOne
()
self
.
assertEqual
(
bucket
.
MERGE_WEIGHT
(
42
,
17
),
42
)
def
test_suite
():
return
unittest
.
TestSuite
((
...
...
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