[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/authentication/ Make sure events implement right interfaces

Dmitry Vasiliev dima at hlabs.spb.ru
Tue Aug 23 04:27:19 EDT 2005


Log message for revision 38032:
  Make sure events implement right interfaces
  

Changed:
  U   Zope3/trunk/src/zope/app/authentication/interfaces.py
  U   Zope3/trunk/src/zope/app/authentication/tests.py

-=-
Modified: Zope3/trunk/src/zope/app/authentication/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/authentication/interfaces.py	2005-08-23 05:22:19 UTC (rev 38031)
+++ Zope3/trunk/src/zope/app/authentication/interfaces.py	2005-08-23 08:27:18 UTC (rev 38032)
@@ -163,6 +163,13 @@
 
 
 class AuthenticatedPrincipalCreated:
+    """
+    >>> from zope.interface.verify import verifyObject
+    >>> event = AuthenticatedPrincipalCreated("authentication", "principal",
+    ...     "info", "request")
+    >>> verifyObject(IAuthenticatedPrincipalCreated, event)
+    True
+    """
 
     zope.interface.implements(IAuthenticatedPrincipalCreated)
 
@@ -178,6 +185,13 @@
 
 
 class FoundPrincipalCreated:
+    """
+    >>> from zope.interface.verify import verifyObject
+    >>> event = FoundPrincipalCreated("authentication", "principal",
+    ...     "info")
+    >>> verifyObject(IFoundPrincipalCreated, event)
+    True
+    """
 
     zope.interface.implements(IFoundPrincipalCreated)
 
@@ -217,16 +231,23 @@
         """
 
 class IGroupAdded(zope.interface.Interface):
+    """A group has been added."""
 
     group = zope.interface.Attribute("""The group that was defined""")
 
 
 class GroupAdded:
+    """
+    >>> from zope.interface.verify import verifyObject
+    >>> event = GroupAdded("group")
+    >>> verifyObject(IGroupAdded, event)
+    True
+    """
 
     zope.interface.implements(IGroupAdded)
 
-    def __init__(self, principal):
-        self.principal = principal
+    def __init__(self, group):
+        self.group = group
 
     def __repr__(self):
-        return "<GroupAdded %r>" % self.principal.id
+        return "<GroupAdded %r>" % self.group.id

Modified: Zope3/trunk/src/zope/app/authentication/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/authentication/tests.py	2005-08-23 05:22:19 UTC (rev 38031)
+++ Zope3/trunk/src/zope/app/authentication/tests.py	2005-08-23 08:27:18 UTC (rev 38032)
@@ -95,6 +95,7 @@
 
 def test_suite():
     return unittest.TestSuite((
+        doctest.DocTestSuite('zope.app.authentication.interfaces'),
         doctest.DocTestSuite('zope.app.authentication.generic'),
         doctest.DocTestSuite('zope.app.authentication.httpplugins'),
         doctest.DocTestSuite('zope.app.authentication.ftpplugins'),



More information about the Zope3-Checkins mailing list