[Checkins] SVN: zope.securitypolicy/trunk/src/zope/securitypolicy/zopepolicy.txt Fixed a broken test: dict objects are unhashable

Shane Hathaway shane at hathawaymix.org
Sat Jul 12 18:10:58 EDT 2008


Log message for revision 88301:
  Fixed a broken test: dict objects are unhashable
  

Changed:
  U   zope.securitypolicy/trunk/src/zope/securitypolicy/zopepolicy.txt

-=-
Modified: zope.securitypolicy/trunk/src/zope/securitypolicy/zopepolicy.txt
===================================================================
--- zope.securitypolicy/trunk/src/zope/securitypolicy/zopepolicy.txt	2008-07-12 22:04:13 UTC (rev 88300)
+++ zope.securitypolicy/trunk/src/zope/securitypolicy/zopepolicy.txt	2008-07-12 22:10:57 UTC (rev 88301)
@@ -498,10 +498,16 @@
 authentication service:
 
   >>> from zope.app.security.interfaces import IAuthentication
-  >>> class FauxPrincipals(dict):
+  >>> class FauxPrincipals(object):
   ...     zope.interface.implements(IAuthentication)
+  ...     def __init__(self):
+  ...         self.data = {}
+  ...     def __setitem__(self, key, value):
+  ...         self.data[key] = value
+  ...     def __getitem__(self, key):
+  ...         return self.data[key]
   ...     def getPrincipal(self, id):
-  ...         return self[id]
+  ...         return self.data[id]
 
   >>> auth = FauxPrincipals()
 



More information about the Checkins mailing list