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
4b48e0f1
Commit
4b48e0f1
authored
Dec 04, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coverage for BTrees.check.type_and_adr.
parent
130b00ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
BTrees/tests/test_check.py
BTrees/tests/test_check.py
+18
-6
No files found.
BTrees/tests/test_check.py
View file @
4b48e0f1
...
@@ -216,14 +216,26 @@ class Test_check(unittest.TestCase):
...
@@ -216,14 +216,26 @@ class Test_check(unittest.TestCase):
self
.
fail
(
"expected check(tree) to catch the problem"
)
self
.
fail
(
"expected check(tree) to catch the problem"
)
class
Test_
helpers
(
unittest
.
TestCase
):
class
Test_
type_and_adr
(
unittest
.
TestCase
):
def
test_type_and_adr_w_oid
(
self
):
def
_callFUT
(
self
,
obj
):
from
BTrees.check
import
type_and_adr
from
BTrees.check
import
type_and_adr
class
WOid
(
object
):
return
type_and_adr
(
obj
)
def
test_type_and_adr_w_oid
(
self
):
from
BTrees.utils
import
oid_repr
class
WithOid
(
object
):
_p_oid
=
'DEADBEEF'
_p_oid
=
'DEADBEEF'
t_and_a
=
type_and_adr
(
WOid
())
t_and_a
=
self
.
_callFUT
(
WithOid
())
self
.
assertTrue
(
t_and_a
.
startswith
(
'WOid'
))
self
.
assertTrue
(
t_and_a
.
startswith
(
'WithOid (0x'
))
self
.
assertTrue
(
t_and_a
.
endswith
(
'oid=%s)'
%
oid_repr
(
'DEADBEEF'
)))
def
test_type_and_adr_wo_oid
(
self
):
class
WithoutOid
(
object
):
pass
t_and_a
=
self
.
_callFUT
(
WithoutOid
())
self
.
assertTrue
(
t_and_a
.
startswith
(
'WithoutOid (0x'
))
self
.
assertTrue
(
t_and_a
.
endswith
(
'oid=None)'
))
def
test_suite
():
def
test_suite
():
...
@@ -232,5 +244,5 @@ def test_suite():
...
@@ -232,5 +244,5 @@ def test_suite():
unittest
.
makeSuite
(
Test_crack_btree
),
unittest
.
makeSuite
(
Test_crack_btree
),
unittest
.
makeSuite
(
Test_crack_bucket
),
unittest
.
makeSuite
(
Test_crack_bucket
),
unittest
.
makeSuite
(
Test_check
),
unittest
.
makeSuite
(
Test_check
),
unittest
.
makeSuite
(
Test_
helpers
),
unittest
.
makeSuite
(
Test_
type_and_adr
),
))
))
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