[Zodb-checkins] SVN: ZODB/trunk/ Add overlooked test; fix up import issues.

Tres Seaver cvs-admin at zope.org
Thu Jun 28 21:35:01 UTC 2012


Log message for revision 127151:
  Add overlooked test;  fix up import issues.

Changed:
  _U  ZODB/trunk/
  U   ZODB/trunk/src/ZODB/tests/testPersistentWeakref.py

-=-
Modified: ZODB/trunk/src/ZODB/tests/testPersistentWeakref.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testPersistentWeakref.py	2012-06-28 21:28:21 UTC (rev 127150)
+++ ZODB/trunk/src/ZODB/tests/testPersistentWeakref.py	2012-06-28 21:34:57 UTC (rev 127151)
@@ -27,6 +27,7 @@
     Here's an example. We'll start by creating a persistent object and
     a reference to it:
 
+    >>> import transaction
     >>> from persistent.wref import WeakRef
     >>> import persistent, ZODB.tests.MinPO
     >>> import ZODB.tests.util
@@ -162,6 +163,7 @@
     We'll start by creating a PersistentWeakKeyDictionary and adding
     some persistent objects to it.
 
+    >>> import transaction
     >>> from persistent.wref import PersistentWeakKeyDictionary
     >>> d = PersistentWeakKeyDictionary()
     >>> import ZODB.tests.util
@@ -254,6 +256,20 @@
 
     """
 
+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():
     from doctest import DocTestSuite
     return DocTestSuite()



More information about the Zodb-checkins mailing list