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
dff3fcce
Commit
dff3fcce
authored
Dec 04, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coverage for BTrees.check.classify.
parent
1cdf1943
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
BTrees/tests/test_check.py
BTrees/tests/test_check.py
+44
-1
No files found.
BTrees/tests/test_check.py
View file @
dff3fcce
...
@@ -14,6 +14,46 @@
...
@@ -14,6 +14,46 @@
import
unittest
import
unittest
class
Test_classify
(
unittest
.
TestCase
):
def
_callFUT
(
self
,
obj
):
from
BTrees.check
import
classify
return
classify
(
obj
)
def
test_classify_w_unknown
(
self
):
class
NotClassified
(
object
):
pass
self
.
assertRaises
(
KeyError
,
self
.
_callFUT
,
NotClassified
())
def
test_classify_w_bucket
(
self
):
from
BTrees.OOBTree
import
OOBucketPy
from
BTrees.check
import
TYPE_BUCKET
kind
,
is_mapping
=
self
.
_callFUT
(
OOBucketPy
())
self
.
assertEqual
(
kind
,
TYPE_BUCKET
)
self
.
assertTrue
(
is_mapping
)
def
test_classify_w_set
(
self
):
from
BTrees.OOBTree
import
OOSetPy
from
BTrees.check
import
TYPE_BUCKET
kind
,
is_mapping
=
self
.
_callFUT
(
OOSetPy
())
self
.
assertEqual
(
kind
,
TYPE_BUCKET
)
self
.
assertFalse
(
is_mapping
)
def
test_classify_w_tree
(
self
):
from
BTrees.OOBTree
import
OOBTreePy
from
BTrees.check
import
TYPE_BTREE
kind
,
is_mapping
=
self
.
_callFUT
(
OOBTreePy
())
self
.
assertEqual
(
kind
,
TYPE_BTREE
)
self
.
assertTrue
(
is_mapping
)
def
test_classify_w_treeset
(
self
):
from
BTrees.OOBTree
import
OOTreeSetPy
from
BTrees.check
import
TYPE_BTREE
kind
,
is_mapping
=
self
.
_callFUT
(
OOTreeSetPy
())
self
.
assertEqual
(
kind
,
TYPE_BTREE
)
self
.
assertFalse
(
is_mapping
)
class
Test_check
(
unittest
.
TestCase
):
class
Test_check
(
unittest
.
TestCase
):
def
_callFUT
(
self
,
tree
):
def
_callFUT
(
self
,
tree
):
...
@@ -99,4 +139,7 @@ class Test_check(unittest.TestCase):
...
@@ -99,4 +139,7 @@ class Test_check(unittest.TestCase):
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
Test_check
)
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
Test_classify
),
unittest
.
makeSuite
(
Test_check
),
))
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