[Checkins] SVN: PluggableAuthService/trunk/ - BasePlugin: The listInterfaces method only considered the old-style

Jens Vagelpohl jens at dataflake.org
Tue Oct 17 23:10:52 EDT 2006


Log message for revision 70769:
  - BasePlugin: The listInterfaces method only considered the old-style
    __implements__ machinery when determining interfaces provided by
    a plugin instance.
  

Changed:
  U   PluggableAuthService/trunk/doc/CHANGES.txt
  U   PluggableAuthService/trunk/plugins/BasePlugin.py
  U   PluggableAuthService/trunk/tests/conformance.py

-=-
Modified: PluggableAuthService/trunk/doc/CHANGES.txt
===================================================================
--- PluggableAuthService/trunk/doc/CHANGES.txt	2006-10-17 22:20:28 UTC (rev 70768)
+++ PluggableAuthService/trunk/doc/CHANGES.txt	2006-10-18 03:10:50 UTC (rev 70769)
@@ -10,6 +10,10 @@
 
     Bugs Fixed
 
+      - BasePlugin: The listInterfaces method only considered the old-style
+        __implements__ machinery when determining interfaces provided by
+        a plugin instance.
+
       - ZODBUserManager: Already encrypted passwords were encrypted again in
         addUser and updateUserPassword.
         (http://www.zope.org/Collectors/Zope/1926)

Modified: PluggableAuthService/trunk/plugins/BasePlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/BasePlugin.py	2006-10-17 22:20:28 UTC (rev 70768)
+++ PluggableAuthService/trunk/plugins/BasePlugin.py	2006-10-18 03:10:50 UTC (rev 70769)
@@ -25,7 +25,9 @@
 
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
-from Products.PluggableAuthService.utils import classImplements, implementedBy
+from Products.PluggableAuthService.utils import classImplements
+from Products.PluggableAuthService.utils import implementedBy
+from Products.PluggableAuthService.utils import providedBy
 from Products.PluggableAuthService.permissions import ManageUsers
 
 class BasePlugin(SimpleItem, PropertyManager):
@@ -60,7 +62,7 @@
 
         results = []
 
-        for iface in flattenInterfaces( self.__implements__ ):
+        for iface in flattenInterfaces( providedBy( self ) ):
             results.append( iface.__name__ )
 
         return results

Modified: PluggableAuthService/trunk/tests/conformance.py
===================================================================
--- PluggableAuthService/trunk/tests/conformance.py	2006-10-17 22:20:28 UTC (rev 70768)
+++ PluggableAuthService/trunk/tests/conformance.py	2006-10-18 03:10:50 UTC (rev 70769)
@@ -22,6 +22,7 @@
 except ImportError:
     from Interface.Verify import verifyClass
 
+
 class IExtractionPlugin_conformance:
 
     def test_IExtractionPlugin_conformance( self ):
@@ -31,6 +32,15 @@
 
         verifyClass( IExtractionPlugin, self._getTargetClass() )
 
+    def test_IExtractionPlugin_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IExtractionPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IExtractionPlugin.__name__ in listed)
+
+
 class ILoginPasswordExtractionPlugin_conformance:
 
     def test_ILoginPasswordExtractionPlugin_conformance( self ):
@@ -40,6 +50,15 @@
 
         verifyClass( ILoginPasswordExtractionPlugin, self._getTargetClass() )
 
+    def test_ILoginPasswordExtractionPlugin_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import ILoginPasswordExtractionPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(ILoginPasswordExtractionPlugin.__name__ in listed)
+
+
 class ILoginPasswordHostExtractionPlugin_conformance:
 
     def test_ILoginPasswordHostExtractionPlugin_conformance( self ):
@@ -50,6 +69,15 @@
         verifyClass( ILoginPasswordHostExtractionPlugin
                    , self._getTargetClass() )
 
+    def test_ILoginPasswordHostExtractionPlugin_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import ILoginPasswordHostExtractionPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(ILoginPasswordHostExtractionPlugin.__name__ in listed)
+
+
 class IChallengePlugin_conformance:
 
     def test_IChallengePlugin_conformance( self ):
@@ -59,6 +87,15 @@
 
         verifyClass( IChallengePlugin, self._getTargetClass() )
 
+    def test_IChallengePlugin_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IChallengePlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IChallengePlugin.__name__ in listed)
+
+
 class ICredentialsUpdatePlugin_conformance:
 
     def test_ICredentialsUpdatePlugin_conformance( self ):
@@ -68,6 +105,15 @@
 
         verifyClass( ICredentialsUpdatePlugin, self._getTargetClass() )
 
+    def test_ICredentialsUpdatePlugin_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import ICredentialsUpdatePlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(ICredentialsUpdatePlugin.__name__ in listed)
+
+
 class ICredentialsResetPlugin_conformance:
 
     def test_ICredentialsResetPlugin_conformance( self ):
@@ -77,7 +123,15 @@
 
         verifyClass( ICredentialsResetPlugin, self._getTargetClass() )
 
+    def test_ICredentialsResetPlugin_listInterfaces(self):
 
+        from Products.PluggableAuthService.interfaces.plugins \
+            import ICredentialsResetPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(ICredentialsResetPlugin.__name__ in listed)
+
+
 class IAuthenticationPlugin_conformance:
 
     def test_AuthenticationPlugin_conformance( self ):
@@ -87,7 +141,15 @@
 
         verifyClass( IAuthenticationPlugin, self._getTargetClass() )
 
+    def test_IAuthenticationPlugin_listInterfaces(self):
 
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IAuthenticationPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IAuthenticationPlugin.__name__ in listed)
+
+
 class IUserEnumerationPlugin_conformance:
 
     def test_UserEnumerationPlugin_conformance( self ):
@@ -97,7 +159,15 @@
 
         verifyClass( IUserEnumerationPlugin, self._getTargetClass() )
 
+    def test_IUserEnumerationPlugin_listInterfaces(self):
 
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IUserEnumerationPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IUserEnumerationPlugin.__name__ in listed)
+
+
 class IUserAdderPlugin_conformance:
 
     def test_UserAdderPlugin_conformance( self ):
@@ -107,7 +177,15 @@
 
         verifyClass( IUserAdderPlugin, self._getTargetClass() )
 
+    def test_IUserAdderPlugin_listInterfaces(self):
 
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IUserAdderPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IUserAdderPlugin.__name__ in listed)
+
+
 class IGroupEnumerationPlugin_conformance:
 
     def test_GroupEnumerationPlugin_conformance( self ):
@@ -117,7 +195,15 @@
 
         verifyClass( IGroupEnumerationPlugin, self._getTargetClass() )
 
+    def test_IGroupEnumerationPlugin_listInterfaces(self):
 
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IGroupEnumerationPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IGroupEnumerationPlugin.__name__ in listed)
+
+
 class IGroupsPlugin_conformance:
 
     def test_GroupsPlugin_conformance( self ):
@@ -127,7 +213,15 @@
 
         verifyClass( IGroupsPlugin, self._getTargetClass() )
 
+    def test_IGroupsPlugin_listInterfaces(self):
 
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IGroupsPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IGroupsPlugin.__name__ in listed)
+
+
 class IRoleEnumerationPlugin_conformance:
 
     def test_RoleEnumerationPlugin_conformance( self ):
@@ -137,7 +231,15 @@
 
         verifyClass( IRoleEnumerationPlugin, self._getTargetClass() )
 
+    def test_IRoleEnumerationPlugin_listInterfaces(self):
 
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IRoleEnumerationPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IRoleEnumerationPlugin.__name__ in listed)
+
+
 class IRolesPlugin_conformance:
 
     def test_RolesPlugin_conformance( self ):
@@ -147,6 +249,15 @@
 
         verifyClass( IRolesPlugin, self._getTargetClass() )
 
+    def test_IRolesPlugin_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IRolesPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IRolesPlugin.__name__ in listed)
+
+
 class IRoleAssignerPlugin_conformance:
 
     def test_RoleAssignerPlugin_conformance( self ):
@@ -156,6 +267,15 @@
 
         verifyClass( IRoleAssignerPlugin, self._getTargetClass() )
 
+    def test_IRoleAssignerPlugin_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IRoleAssignerPlugin
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IRoleAssignerPlugin.__name__ in listed)
+
+
 class IChallengeProtocolChooser_conformance:
 
     def test_ChallengeProtocolChooser_conformance( self ):
@@ -165,6 +285,15 @@
 
         verifyClass( IChallengeProtocolChooser, self._getTargetClass() )
 
+    def test_IChallengeProtocolChooser_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IChallengeProtocolChooser
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IChallengeProtocolChooser.__name__ in listed)
+
+
 class IRequestTypeSniffer_conformance:
 
     def test_RequestTypeSniffer_conformance( self ):
@@ -174,6 +303,15 @@
 
         verifyClass( IRequestTypeSniffer, self._getTargetClass() )
 
+    def test_IRequestTypeSniffer_listInterfaces(self):
+
+        from Products.PluggableAuthService.interfaces.plugins \
+            import IRequestTypeSniffer
+
+        listed = self._makeOne().listInterfaces()
+        self.failUnless(IRequestTypeSniffer.__name__ in listed)
+
+
 class IUserFolder_conformance:
 
     def test_conformance_IUserFolder( self ):
@@ -183,6 +321,7 @@
 
         verifyClass( IUserFolder, self._getTargetClass() )
 
+
 class IBasicUser_conformance:
 
     def test_conformance_IBasicUser( self ):
@@ -192,6 +331,7 @@
 
         verifyClass( IBasicUser, self._getTargetClass() )
 
+
 class IPropertiedUser_conformance:
 
     def test_conformance_IPropertiedUser( self ):
@@ -201,6 +341,7 @@
 
         verifyClass( IPropertiedUser, self._getTargetClass() )
 
+
 class IPropertySheet_conformance:
 
     def test_conformance_IPropertySheet( self ):
@@ -209,3 +350,4 @@
             import IPropertySheet
 
         verifyClass( IPropertySheet, self._getTargetClass() )
+



More information about the Checkins mailing list