Back to index

plone3  3.1.7
conformance.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights
00004 # Reserved.
00005 #
00006 # This software is subject to the provisions of the Zope Public License,
00007 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this
00008 # distribution.
00009 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00010 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00011 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00012 # FOR A PARTICULAR PURPOSE.
00013 #
00014 ##############################################################################
00015 """ Base classes for testing plugin interface conformance.
00016 
00017 $Id: conformance.py 70769 2006-10-18 03:10:50Z jens $
00018 """
00019 
00020 try:
00021     from zope.interface.verify import verifyClass
00022 except ImportError:
00023     from Interface.Verify import verifyClass
00024 
00025 
00026 class IExtractionPlugin_conformance:
00027 
00028     def test_IExtractionPlugin_conformance( self ):
00029 
00030         from Products.PluggableAuthService.interfaces.plugins \
00031             import IExtractionPlugin
00032 
00033         verifyClass( IExtractionPlugin, self._getTargetClass() )
00034 
00035     def test_IExtractionPlugin_listInterfaces(self):
00036 
00037         from Products.PluggableAuthService.interfaces.plugins \
00038             import IExtractionPlugin
00039 
00040         listed = self._makeOne().listInterfaces()
00041         self.failUnless(IExtractionPlugin.__name__ in listed)
00042 
00043 
00044 class ILoginPasswordExtractionPlugin_conformance:
00045 
00046     def test_ILoginPasswordExtractionPlugin_conformance( self ):
00047 
00048         from Products.PluggableAuthService.interfaces.plugins \
00049             import ILoginPasswordExtractionPlugin
00050 
00051         verifyClass( ILoginPasswordExtractionPlugin, self._getTargetClass() )
00052 
00053     def test_ILoginPasswordExtractionPlugin_listInterfaces(self):
00054 
00055         from Products.PluggableAuthService.interfaces.plugins \
00056             import ILoginPasswordExtractionPlugin
00057 
00058         listed = self._makeOne().listInterfaces()
00059         self.failUnless(ILoginPasswordExtractionPlugin.__name__ in listed)
00060 
00061 
00062 class ILoginPasswordHostExtractionPlugin_conformance:
00063 
00064     def test_ILoginPasswordHostExtractionPlugin_conformance( self ):
00065 
00066         from Products.PluggableAuthService.interfaces.plugins \
00067             import ILoginPasswordHostExtractionPlugin
00068 
00069         verifyClass( ILoginPasswordHostExtractionPlugin
00070                    , self._getTargetClass() )
00071 
00072     def test_ILoginPasswordHostExtractionPlugin_listInterfaces(self):
00073 
00074         from Products.PluggableAuthService.interfaces.plugins \
00075             import ILoginPasswordHostExtractionPlugin
00076 
00077         listed = self._makeOne().listInterfaces()
00078         self.failUnless(ILoginPasswordHostExtractionPlugin.__name__ in listed)
00079 
00080 
00081 class IChallengePlugin_conformance:
00082 
00083     def test_IChallengePlugin_conformance( self ):
00084 
00085         from Products.PluggableAuthService.interfaces.plugins \
00086             import IChallengePlugin
00087 
00088         verifyClass( IChallengePlugin, self._getTargetClass() )
00089 
00090     def test_IChallengePlugin_listInterfaces(self):
00091 
00092         from Products.PluggableAuthService.interfaces.plugins \
00093             import IChallengePlugin
00094 
00095         listed = self._makeOne().listInterfaces()
00096         self.failUnless(IChallengePlugin.__name__ in listed)
00097 
00098 
00099 class ICredentialsUpdatePlugin_conformance:
00100 
00101     def test_ICredentialsUpdatePlugin_conformance( self ):
00102 
00103         from Products.PluggableAuthService.interfaces.plugins \
00104             import ICredentialsUpdatePlugin
00105 
00106         verifyClass( ICredentialsUpdatePlugin, self._getTargetClass() )
00107 
00108     def test_ICredentialsUpdatePlugin_listInterfaces(self):
00109 
00110         from Products.PluggableAuthService.interfaces.plugins \
00111             import ICredentialsUpdatePlugin
00112 
00113         listed = self._makeOne().listInterfaces()
00114         self.failUnless(ICredentialsUpdatePlugin.__name__ in listed)
00115 
00116 
00117 class ICredentialsResetPlugin_conformance:
00118 
00119     def test_ICredentialsResetPlugin_conformance( self ):
00120 
00121         from Products.PluggableAuthService.interfaces.plugins \
00122             import ICredentialsResetPlugin
00123 
00124         verifyClass( ICredentialsResetPlugin, self._getTargetClass() )
00125 
00126     def test_ICredentialsResetPlugin_listInterfaces(self):
00127 
00128         from Products.PluggableAuthService.interfaces.plugins \
00129             import ICredentialsResetPlugin
00130 
00131         listed = self._makeOne().listInterfaces()
00132         self.failUnless(ICredentialsResetPlugin.__name__ in listed)
00133 
00134 
00135 class IAuthenticationPlugin_conformance:
00136 
00137     def test_AuthenticationPlugin_conformance( self ):
00138 
00139         from Products.PluggableAuthService.interfaces.plugins \
00140             import IAuthenticationPlugin
00141 
00142         verifyClass( IAuthenticationPlugin, self._getTargetClass() )
00143 
00144     def test_IAuthenticationPlugin_listInterfaces(self):
00145 
00146         from Products.PluggableAuthService.interfaces.plugins \
00147             import IAuthenticationPlugin
00148 
00149         listed = self._makeOne().listInterfaces()
00150         self.failUnless(IAuthenticationPlugin.__name__ in listed)
00151 
00152 
00153 class IUserEnumerationPlugin_conformance:
00154 
00155     def test_UserEnumerationPlugin_conformance( self ):
00156 
00157         from Products.PluggableAuthService.interfaces.plugins \
00158             import IUserEnumerationPlugin
00159 
00160         verifyClass( IUserEnumerationPlugin, self._getTargetClass() )
00161 
00162     def test_IUserEnumerationPlugin_listInterfaces(self):
00163 
00164         from Products.PluggableAuthService.interfaces.plugins \
00165             import IUserEnumerationPlugin
00166 
00167         listed = self._makeOne().listInterfaces()
00168         self.failUnless(IUserEnumerationPlugin.__name__ in listed)
00169 
00170 
00171 class IUserAdderPlugin_conformance:
00172 
00173     def test_UserAdderPlugin_conformance( self ):
00174 
00175         from Products.PluggableAuthService.interfaces.plugins \
00176             import IUserAdderPlugin
00177 
00178         verifyClass( IUserAdderPlugin, self._getTargetClass() )
00179 
00180     def test_IUserAdderPlugin_listInterfaces(self):
00181 
00182         from Products.PluggableAuthService.interfaces.plugins \
00183             import IUserAdderPlugin
00184 
00185         listed = self._makeOne().listInterfaces()
00186         self.failUnless(IUserAdderPlugin.__name__ in listed)
00187 
00188 
00189 class IGroupEnumerationPlugin_conformance:
00190 
00191     def test_GroupEnumerationPlugin_conformance( self ):
00192 
00193         from Products.PluggableAuthService.interfaces.plugins \
00194             import IGroupEnumerationPlugin
00195 
00196         verifyClass( IGroupEnumerationPlugin, self._getTargetClass() )
00197 
00198     def test_IGroupEnumerationPlugin_listInterfaces(self):
00199 
00200         from Products.PluggableAuthService.interfaces.plugins \
00201             import IGroupEnumerationPlugin
00202 
00203         listed = self._makeOne().listInterfaces()
00204         self.failUnless(IGroupEnumerationPlugin.__name__ in listed)
00205 
00206 
00207 class IGroupsPlugin_conformance:
00208 
00209     def test_GroupsPlugin_conformance( self ):
00210 
00211         from Products.PluggableAuthService.interfaces.plugins \
00212             import IGroupsPlugin
00213 
00214         verifyClass( IGroupsPlugin, self._getTargetClass() )
00215 
00216     def test_IGroupsPlugin_listInterfaces(self):
00217 
00218         from Products.PluggableAuthService.interfaces.plugins \
00219             import IGroupsPlugin
00220 
00221         listed = self._makeOne().listInterfaces()
00222         self.failUnless(IGroupsPlugin.__name__ in listed)
00223 
00224 
00225 class IRoleEnumerationPlugin_conformance:
00226 
00227     def test_RoleEnumerationPlugin_conformance( self ):
00228 
00229         from Products.PluggableAuthService.interfaces.plugins \
00230             import IRoleEnumerationPlugin
00231 
00232         verifyClass( IRoleEnumerationPlugin, self._getTargetClass() )
00233 
00234     def test_IRoleEnumerationPlugin_listInterfaces(self):
00235 
00236         from Products.PluggableAuthService.interfaces.plugins \
00237             import IRoleEnumerationPlugin
00238 
00239         listed = self._makeOne().listInterfaces()
00240         self.failUnless(IRoleEnumerationPlugin.__name__ in listed)
00241 
00242 
00243 class IRolesPlugin_conformance:
00244 
00245     def test_RolesPlugin_conformance( self ):
00246 
00247         from Products.PluggableAuthService.interfaces.plugins \
00248             import IRolesPlugin
00249 
00250         verifyClass( IRolesPlugin, self._getTargetClass() )
00251 
00252     def test_IRolesPlugin_listInterfaces(self):
00253 
00254         from Products.PluggableAuthService.interfaces.plugins \
00255             import IRolesPlugin
00256 
00257         listed = self._makeOne().listInterfaces()
00258         self.failUnless(IRolesPlugin.__name__ in listed)
00259 
00260 
00261 class IRoleAssignerPlugin_conformance:
00262 
00263     def test_RoleAssignerPlugin_conformance( self ):
00264 
00265         from Products.PluggableAuthService.interfaces.plugins \
00266             import IRoleAssignerPlugin
00267 
00268         verifyClass( IRoleAssignerPlugin, self._getTargetClass() )
00269 
00270     def test_IRoleAssignerPlugin_listInterfaces(self):
00271 
00272         from Products.PluggableAuthService.interfaces.plugins \
00273             import IRoleAssignerPlugin
00274 
00275         listed = self._makeOne().listInterfaces()
00276         self.failUnless(IRoleAssignerPlugin.__name__ in listed)
00277 
00278 
00279 class IChallengeProtocolChooser_conformance:
00280 
00281     def test_ChallengeProtocolChooser_conformance( self ):
00282 
00283         from Products.PluggableAuthService.interfaces.plugins \
00284             import IChallengeProtocolChooser
00285 
00286         verifyClass( IChallengeProtocolChooser, self._getTargetClass() )
00287 
00288     def test_IChallengeProtocolChooser_listInterfaces(self):
00289 
00290         from Products.PluggableAuthService.interfaces.plugins \
00291             import IChallengeProtocolChooser
00292 
00293         listed = self._makeOne().listInterfaces()
00294         self.failUnless(IChallengeProtocolChooser.__name__ in listed)
00295 
00296 
00297 class IRequestTypeSniffer_conformance:
00298 
00299     def test_RequestTypeSniffer_conformance( self ):
00300 
00301         from Products.PluggableAuthService.interfaces.plugins \
00302             import IRequestTypeSniffer
00303 
00304         verifyClass( IRequestTypeSniffer, self._getTargetClass() )
00305 
00306     def test_IRequestTypeSniffer_listInterfaces(self):
00307 
00308         from Products.PluggableAuthService.interfaces.plugins \
00309             import IRequestTypeSniffer
00310 
00311         listed = self._makeOne().listInterfaces()
00312         self.failUnless(IRequestTypeSniffer.__name__ in listed)
00313 
00314 
00315 class IUserFolder_conformance:
00316 
00317     def test_conformance_IUserFolder( self ):
00318 
00319         from Products.PluggableAuthService.interfaces.authservice \
00320             import IUserFolder
00321 
00322         verifyClass( IUserFolder, self._getTargetClass() )
00323 
00324 
00325 class IBasicUser_conformance:
00326 
00327     def test_conformance_IBasicUser( self ):
00328 
00329         from Products.PluggableAuthService.interfaces.authservice \
00330             import IBasicUser
00331 
00332         verifyClass( IBasicUser, self._getTargetClass() )
00333 
00334 
00335 class IPropertiedUser_conformance:
00336 
00337     def test_conformance_IPropertiedUser( self ):
00338 
00339         from Products.PluggableAuthService.interfaces.authservice \
00340             import IPropertiedUser
00341 
00342         verifyClass( IPropertiedUser, self._getTargetClass() )
00343 
00344 
00345 class IPropertySheet_conformance:
00346 
00347     def test_conformance_IPropertySheet( self ):
00348 
00349         from Products.PluggableAuthService.interfaces.propertysheets \
00350             import IPropertySheet
00351 
00352         verifyClass( IPropertySheet, self._getTargetClass() )
00353