[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zodb-checkins
Subject:    [Zodb-checkins] SVN: ZODB/trunk/ Add overlooked test; fix up import issues.
From:       Tres Seaver <cvs-admin () zope ! org>
Date:       2012-06-28 21:35:01
Message-ID: 20120628213501.0C6B67083BC () cvs ! zope ! org
[Download RAW message or body]

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()

_______________________________________________
Zodb-checkins mailing list
Zodb-checkins@zope.org
https://mail.zope.org/mailman/listinfo/zodb-checkins
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic