Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Nicolas Wavrant
ZODB
Commits
80ef395a
Commit
80ef395a
authored
Jun 28, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add overlooked test; fix up import issues.
parent
bd54ba42
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
src/ZODB/tests/testPersistentWeakref.py
src/ZODB/tests/testPersistentWeakref.py
+16
-0
No files found.
src/ZODB/tests/testPersistentWeakref.py
View file @
80ef395a
...
@@ -27,6 +27,7 @@ def test_weakrefs_functional():
...
@@ -27,6 +27,7 @@ def test_weakrefs_functional():
Here's an example. We'll start by creating a persistent object and
Here's an example. We'll start by creating a persistent object and
a reference to it:
a reference to it:
>>> import transaction
>>> from persistent.wref import WeakRef
>>> from persistent.wref import WeakRef
>>> import persistent, ZODB.tests.MinPO
>>> import persistent, ZODB.tests.MinPO
>>> import ZODB.tests.util
>>> import ZODB.tests.util
...
@@ -162,6 +163,7 @@ def test_PersistentWeakKeyDictionary():
...
@@ -162,6 +163,7 @@ def test_PersistentWeakKeyDictionary():
We'll start by creating a PersistentWeakKeyDictionary and adding
We'll start by creating a PersistentWeakKeyDictionary and adding
some persistent objects to it.
some persistent objects to it.
>>> import transaction
>>> from persistent.wref import PersistentWeakKeyDictionary
>>> from persistent.wref import PersistentWeakKeyDictionary
>>> d = PersistentWeakKeyDictionary()
>>> d = PersistentWeakKeyDictionary()
>>> import ZODB.tests.util
>>> import ZODB.tests.util
...
@@ -254,6 +256,20 @@ def test_PersistentWeakKeyDictionary():
...
@@ -254,6 +256,20 @@ def test_PersistentWeakKeyDictionary():
"""
"""
def
test_PersistentWeakKeyDictionary_get
():
"""
>>> import ZODB.tests.util
>>> from persistent.wref import PersistentWeakKeyDictionary
>>> key = ZODB.tests.util.P("key")
>>> missing = ZODB.tests.util.P("missing")
>>> d = PersistentWeakKeyDictionary([(key, 1)])
>>> d.get(key)
1
>>> d.get(missing)
>>> d.get(missing, 12)
12
"""
def
test_suite
():
def
test_suite
():
from
doctest
import
DocTestSuite
from
doctest
import
DocTestSuite
return
DocTestSuite
()
return
DocTestSuite
()
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