CVS: Products/PluggableAuthService/tests - test_PluggableAuthService.py:1.19 conformance.py:1.4

Zachery Bir <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Update of /cvs-repository/Products/PluggableAuthService/tests
In directory cvs.zope.org:/tmp/cvs-serv29036/tests

Modified Files:
	test_PluggableAuthService.py conformance.py 
Log Message:
Merging per-plugin id mangling and Zope 2.7/2.8 Interface compatibility code


=== Products/PluggableAuthService/tests/test_PluggableAuthService.py 1.18 => 1.19 ===
--- Products/PluggableAuthService/tests/test_PluggableAuthService.py:1.18	Fri May 27 15:10:45 2005
+++ Products/PluggableAuthService/tests/test_PluggableAuthService.py	Wed Jul  6 14:49:05 2005
@@ -379,7 +379,7 @@
              import IUserEnumerationPlugin
 
         enumerator = DummyUserEnumerator( user_id, login )
-        directlyProvides( enumerator, ( IUserEnumerationPlugin, ) )
+        directlyProvides( enumerator, IUserEnumerationPlugin )
 
         return enumerator
 
@@ -389,7 +389,7 @@
              import IGroupEnumerationPlugin
 
         enumerator = DummyGroupEnumerator( group_id )
-        directlyProvides( enumerator, ( IGroupEnumerationPlugin, ) )
+        directlyProvides( enumerator, IGroupEnumerationPlugin )
 
         return enumerator
 
@@ -401,8 +401,8 @@
              import IGroupEnumerationPlugin
 
         enumerator = DummySuperEnumerator( user_id, login, group_id )
-        directlyProvides( enumerator, ( IUserEnumerationPlugin,
-                                        IGroupEnumerationPlugin ) )
+        directlyProvides( enumerator
+                        , IUserEnumerationPlugin, IGroupEnumerationPlugin )
 
         return enumerator
 
@@ -411,7 +411,7 @@
              import IGroupsPlugin
 
         gp = DummyGroupPlugin(id, groups=groups)
-        directlyProvides( gp, (IGroupsPlugin,) )
+        directlyProvides( gp, IGroupsPlugin )
         return gp
 
     def _makeChallengePlugin(self, id, klass):
@@ -419,7 +419,7 @@
              import IChallengePlugin
 
         cp = klass(id)
-        directlyProvides( cp, (IChallengePlugin,) )
+        directlyProvides( cp, IChallengePlugin )
         return cp
 
     def test_conformance_IUserFolder( self ):
@@ -456,7 +456,7 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
         zcuf._setObject( 'login', login )
@@ -483,14 +483,14 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
 
         zcuf._setObject( 'login', login )
 
         always = DummyPlugin()
-        directlyProvides( always, ( IAuthenticationPlugin, ) )
+        directlyProvides( always, IAuthenticationPlugin )
         always.authenticateCredentials = lambda creds: ('baz', None)
 
         zcuf._setObject( 'always', always )
@@ -520,14 +520,14 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
 
         zcuf._setObject( 'login', login )
 
         extra = DummyPlugin()
-        directlyProvides( extra, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( extra, IExtractionPlugin, IAuthenticationPlugin )
         extra.extractCredentials = _extractExtra
         extra.authenticateCredentials = _authExtra
 
@@ -568,14 +568,14 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
 
         zcuf._setObject( 'login', login )
 
         borked = DummyPlugin()
-        directlyProvides( borked, ( IExtractionPlugin, ) )
+        directlyProvides( borked, IExtractionPlugin )
         borked.extractCredentials = lambda req: 'abc'
 
         zcuf._setObject( 'borked', borked )
@@ -614,7 +614,7 @@
         zcuf = self._makeOne( plugins )
 
         borked = DummyPlugin()
-        directlyProvides( borked, ( IExtractionPlugin, ) )
+        directlyProvides( borked, IExtractionPlugin )
         borked.extractCredentials = lambda req: 'abc'
 
         zcuf._setObject( 'borked', borked )
@@ -644,14 +644,14 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
 
         zcuf._setObject( 'login', login )
 
         borked = DummyPlugin()
-        directlyProvides( borked, ( IAuthenticationPlugin, ) )
+        directlyProvides( borked, IAuthenticationPlugin )
         borked.authenticateCredentials = lambda creds: creds['nonesuch']
 
         zcuf._setObject( 'borked', borked )
@@ -887,7 +887,7 @@
         zcuf = self._makeOne( plugins )
 
         bar = DummyPlugin()
-        directlyProvides( bar, ( IUserFactoryPlugin, ) )
+        directlyProvides( bar, IUserFactoryPlugin )
 
         def _makeUser( user_id, name ):
             user = FauxUser( user_id )
@@ -921,13 +921,13 @@
         zcuf = self._makeOne( plugins )
 
         foo = DummyPlugin()
-        directlyProvides( foo, ( IPropertiesPlugin, ) )
+        directlyProvides( foo, IPropertiesPlugin )
         foo.getPropertiesForUser = lambda user, req: { 'login': user.getId() }
 
         zcuf._setObject( 'foo', foo )
 
         bar = DummyPlugin()
-        directlyProvides( bar, ( IPropertiesPlugin, ) )
+        directlyProvides( bar, IPropertiesPlugin )
         bar.getPropertiesForUser = lambda user, req: { 'a': 0, 'b': 'bar' }
 
         zcuf._setObject( 'bar', bar )
@@ -956,7 +956,7 @@
         zcuf = self._makeOne( plugins )
 
         foo = DummyPlugin()
-        directlyProvides( foo, ( IGroupsPlugin, ) )
+        directlyProvides( foo, IGroupsPlugin )
         foo.getGroupsForPrincipal = lambda user, req: ( 'group1', 'group2' )
 
         zcuf._setObject( 'foo', foo )
@@ -981,11 +981,11 @@
         zcuf = self._makeOne( plugins )
 
         foo = DummyPlugin()
-        directlyProvides( foo, ( IGroupsPlugin, ) )
+        directlyProvides( foo, IGroupsPlugin )
         foo.getGroupsForPrincipal = lambda user, req: ( 'group1', 'group2' )
 
         bar = DummyPlugin()
-        directlyProvides( bar, ( IGroupsPlugin, ) )
+        directlyProvides( bar, IGroupsPlugin )
         bar.getGroupsForPrincipal = lambda user, req: ( 'group3', 'group4' )
 
         zcuf._setObject( 'foo', foo )
@@ -1268,13 +1268,13 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
         zcuf._setObject( 'login', login )
 
         foo = DummyPlugin()
-        directlyProvides( foo, ( IUserEnumerationPlugin, ) )
+        directlyProvides( foo, IUserEnumerationPlugin )
         foo.enumerateUsers = lambda id: id == 'foo' or None
 
         zcuf._setObject( 'foo', foo )
@@ -1315,13 +1315,13 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
         zcuf._setObject( 'login', login )
 
         foo = DummyPlugin()
-        directlyProvides( foo, ( IUserEnumerationPlugin, ) )
+        directlyProvides( foo, IUserEnumerationPlugin )
         foo.enumerateUsers = lambda id: id == 'foo' or None
 
         zcuf._setObject( 'foo', foo )
@@ -1361,13 +1361,13 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
         zcuf._setObject( 'login', login )
 
         olivier = DummyPlugin()
-        directlyProvides( olivier, ( IUserEnumerationPlugin, IRolesPlugin ) )
+        directlyProvides( olivier, IUserEnumerationPlugin, IRolesPlugin )
         olivier.enumerateUsers = lambda id: id == 'foo' or None
         olivier.getRolesForPrincipal = lambda user, req: (
                      user.getId() == 'olivier' and ( 'Hamlet', ) or () )
@@ -1418,7 +1418,7 @@
         nested = self._makeOne( plugins )
 
         anon = DummyPlugin()
-        directlyProvides( anon, ( IAnonymousUserFactoryPlugin, ) )
+        directlyProvides( anon, IAnonymousUserFactoryPlugin )
         anon.createAnonymousUser = _makeAnon
         zcuf._setObject( 'anon', anon )
 
@@ -1485,13 +1485,13 @@
         zcuf = self._makeOne( plugins )
 
         login = DummyPlugin()
-        directlyProvides( login, ( IExtractionPlugin, IAuthenticationPlugin ) )
+        directlyProvides( login, IExtractionPlugin, IAuthenticationPlugin )
         login.extractCredentials = _extractLogin
         login.authenticateCredentials = _authLogin
         zcuf._setObject( 'login', login )
 
         foo = DummyPlugin()
-        directlyProvides( foo, ( IUserEnumerationPlugin, ) )
+        directlyProvides( foo, IUserEnumerationPlugin )
         foo.enumerateUsers = lambda id: id == 'foo' or None
 
         zcuf._setObject( 'foo', foo )
@@ -1744,10 +1744,9 @@
 
         plugins = zcuf._getOb('plugins')
         directlyProvides( creds_store
-                        , ( IExtractionPlugin
-                          , ICredentialsUpdatePlugin
-                          , ICredentialsResetPlugin
-                          )
+                        , IExtractionPlugin
+                        , ICredentialsUpdatePlugin
+                        , ICredentialsResetPlugin
                         )
         plugins.activatePlugin(IExtractionPlugin, 'creds')
         plugins.activatePlugin(ICredentialsUpdatePlugin, 'creds')


=== Products/PluggableAuthService/tests/conformance.py 1.3 => 1.4 ===
--- Products/PluggableAuthService/tests/conformance.py:1.3	Thu Aug 12 11:15:55 2004
+++ Products/PluggableAuthService/tests/conformance.py	Wed Jul  6 14:49:05 2005
@@ -21,7 +21,10 @@
 
     def test_IExtractionPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IExtractionPlugin
 
@@ -31,7 +34,10 @@
 
     def test_ILoginPasswordExtractionPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import ILoginPasswordExtractionPlugin
 
@@ -41,7 +47,10 @@
 
     def test_ILoginPasswordHostExtractionPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import ILoginPasswordHostExtractionPlugin
 
@@ -52,7 +61,10 @@
 
     def test_IChallengePlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IChallengePlugin
 
@@ -62,7 +74,10 @@
 
     def test_ICredentialsUpdatePlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import ICredentialsUpdatePlugin
 
@@ -72,7 +87,10 @@
 
     def test_ICredentialsResetPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import ICredentialsResetPlugin
 
@@ -83,7 +101,10 @@
 
     def test_AuthenticationPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IAuthenticationPlugin
 
@@ -94,7 +115,10 @@
 
     def test_UserEnumerationPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IUserEnumerationPlugin
 
@@ -105,7 +129,10 @@
 
     def test_UserAdderPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IUserAdderPlugin
 
@@ -116,7 +143,10 @@
 
     def test_GroupEnumerationPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IGroupEnumerationPlugin
 
@@ -127,7 +157,10 @@
 
     def test_GroupsPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IGroupsPlugin
 
@@ -138,7 +171,10 @@
 
     def test_RoleEnumerationPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IRoleEnumerationPlugin
 
@@ -149,7 +185,10 @@
 
     def test_RolesPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IRolesPlugin
 
@@ -159,7 +198,10 @@
 
     def test_RoleAssignerPlugin_conformance( self ):
 
-        from Interface.Verify import verifyClass
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            from Interface.Verify import verifyClass
         from Products.PluggableAuthService.interfaces.plugins \
             import IRoleAssignerPlugin
 

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.