SVN: PluggableAuthService/trunk/ Repaired DeprecationWarnings due to use of Zope2 interface verification.

Tres Seaver <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Log message for revision 39972:
  Repaired DeprecationWarnings due to use of Zope2 interface verification.
  
  o Also, tried harder to clean up cyclic trash created by the call to the
    request's '_hold' method.
  
  

Changed:
  U   PluggableAuthService/trunk/doc/CHANGES.txt
  U   PluggableAuthService/trunk/tests/conformance.py
  U   PluggableAuthService/trunk/tests/test_PluggableAuthService.py
  U   PluggableAuthService/trunk/tests/test_UserPropertySheet.py

-=-
Modified: PluggableAuthService/trunk/doc/CHANGES.txt
===================================================================
--- PluggableAuthService/trunk/doc/CHANGES.txt	2005-11-07 20:28:26 UTC (rev 39971)
+++ PluggableAuthService/trunk/doc/CHANGES.txt	2005-11-07 20:49:10 UTC (rev 39972)
@@ -2,43 +2,53 @@
 
   After PluggableAuthService 1.1b2
 
-    - Made ZODBRoleManager plugin check grants to the principal's groups,
-      as well as those made to the principal directly.
+    New Features
 
-    - Repaired unit test breakage (unittest.TestCase instances have
-      'failUnless'/'failIf', rather than 'assertTrue'/'assertFalse').
+      - Made ZODBRoleManager plugin check grants to the principal's groups,
+        as well as those made to the principal directly.
 
-    - Added two new interfaces, IChallengeProtocolChooser and
-      IRequestTypeSniffer. Those are used to select the 'authorization
-      protocol' or 'challenger protocol' to be used for challenging
-      according to the incoming request type.
+      - Added two new interfaces, IChallengeProtocolChooser and
+        IRequestTypeSniffer. Those are used to select the 'authorization
+        protocol' or 'challenger protocol' to be used for challenging
+        according to the incoming request type.
 
-    - Fixed a couple more places where Zope 2-style ``__implements__``
-      where being used to standardize on using ``classImplements``.
+    Bugs Fixed
 
-    - Fixed fallback implementations of ``providedBy`` and
-      ``implementedBy`` to always return a tuple.
+      - Repaired DeprecationWarnings due to use of Zope2 interface verification.
 
-    - Make sure challenge doesn't break if existing instances of the
-      PluginRegistry don't yet have ``IChallengeProtocolChooser`` as a
-      registered interface. (Would be nice to have some sort of
-      migration for the PluginRegistry between PAS releases)
+      - Repaired unit test breakage (unittest.TestCase instances have
+        'failUnless'/'failIf', rather than 'assertTrue'/'assertFalse').
 
-    - Don't assume that just because zope.interface can be imported
-      that Five is present.
+      - Fixed a couple more places where Zope 2-style ``__implements__``
+        were being used to standardize on using ``classImplements``.
 
+      - Fixed fallback implementations of ``providedBy`` and
+        ``implementedBy`` to always return a tuple.
+
+      - Make sure challenge doesn't break if existing instances of the
+        PluginRegistry don't yet have ``IChallengeProtocolChooser`` as a
+        registered interface. (Would be nice to have some sort of
+        migration for the PluginRegistry between PAS releases)
+
+      - Don't assume that just because zope.interface can be imported
+        that Five is present.
+
   PluggableAuthService 1.1b2 (2005/07/14)
 
-    - Missed a 'nocall:' in the Interfaces activation form.
+    Bugs Fixed
 
+      - Repaired a missing 'nocall:' in the Interfaces activation form.
+
   PluggableAuthService 1.1b1 (2005/07/06)
 
-    - PAS-level id mangling is no more. All (optional) mangling is now
-      done on a per-plugin basis.
+    New Features
 
-    - Interfaces used by PAS are now usable in both Zope 2.7 and 2.8
-      (Five compatible)
+      - PAS-level id mangling is no more. All (optional) mangling is now
+        done on a per-plugin basis.
 
+      - Interfaces used by PAS are now usable in both Zope 2.7 and 2.8
+        (Five compatible)
+
   PluggableAuthService 1.0.5 (2005/01/31)
 
     Bugs Fixed

Modified: PluggableAuthService/trunk/tests/conformance.py
===================================================================
--- PluggableAuthService/trunk/tests/conformance.py	2005-11-07 20:28:26 UTC (rev 39971)
+++ PluggableAuthService/trunk/tests/conformance.py	2005-11-07 20:49:10 UTC (rev 39972)
@@ -173,3 +173,22 @@
             import IRequestTypeSniffer
 
         verifyClass( IRequestTypeSniffer, self._getTargetClass() )
+
+class IUserFolder_conformance:
+
+    def test_conformance_IUserFolder( self ):
+
+        from Products.PluggableAuthService.interfaces.authservice \
+            import IUserFolder
+
+        verifyClass( IUserFolder, self._getTargetClass() )
+
+
+class IPropertySheet_conformance:
+
+    def test_conformance_IPropertySheet( self ):
+
+        from Products.PluggableAuthService.interfaces.propertysheets \
+            import IPropertySheet
+
+        verifyClass( IPropertySheet, self._getTargetClass() )

Modified: PluggableAuthService/trunk/tests/test_PluggableAuthService.py
===================================================================
--- PluggableAuthService/trunk/tests/test_PluggableAuthService.py	2005-11-07 20:28:26 UTC (rev 39971)
+++ PluggableAuthService/trunk/tests/test_PluggableAuthService.py	2005-11-07 20:49:10 UTC (rev 39972)
@@ -24,6 +24,8 @@
 
 from Products.PluggableAuthService.utils import directlyProvides
 
+from conformance import IUserFolder_conformance
+
 class DummyPlugin(Implicit):
     pass
 
@@ -322,12 +324,29 @@
     return ( credentials.get( 'salt' ) == 'pepper'
          and (credentials[ 'user' ], credentials[ 'user' ]) or None )
 
-class PluggableAuthServiceTests( unittest.TestCase ):
+class RequestCleaner:
 
+    _request = None
+
+    def _makeRequest( self, *args, **kw ):
+        request = self._request = FauxRequest( *args, **kw )
+        return request
+
+    def _clearRequest( self ):
+        if self._request is not None:
+            self._request._held = []
+
+class PluggableAuthServiceTests( unittest.TestCase
+                               , IUserFolder_conformance
+                               , RequestCleaner
+                               ):
+
     _oldSecurityPolicy = None
 
     def tearDown( self ):
 
+        self._clearRequest()
+
         if self._oldSecurityPolicy is not None:
             setSecurityPolicy( self._oldSecurityPolicy )
 
@@ -422,15 +441,6 @@
         directlyProvides( cp, IChallengePlugin )
         return cp
 
-    def test_conformance_IUserFolder( self ):
-
-        from Products.PluggableAuthService.interfaces.authservice \
-            import IUserFolder
-
-        from Interface.Verify import verifyClass
-
-        verifyClass( IUserFolder, self._getTargetClass() )
-
     def test_empty( self ):
 
         zcuf = self._makeOne()

Modified: PluggableAuthService/trunk/tests/test_UserPropertySheet.py
===================================================================
--- PluggableAuthService/trunk/tests/test_UserPropertySheet.py	2005-11-07 20:28:26 UTC (rev 39971)
+++ PluggableAuthService/trunk/tests/test_UserPropertySheet.py	2005-11-07 20:49:10 UTC (rev 39972)
@@ -15,8 +15,12 @@
 import unittest
 from DateTime.DateTime import DateTime
 
-class UserPropertySheetTests( unittest.TestCase ):
+from conformance import IPropertySheet_conformance
 
+class UserPropertySheetTests( unittest.TestCase
+                            , IPropertySheet_conformance
+                            ):
+
     _SCHEMA = ( ( 's', 'string'  )
               , ( 'i', 'int'     )
               , ( 'f', 'float'   )
@@ -45,15 +49,6 @@
 
         return self._getTargetClass()( *args, **kw )
 
-    def test_conformance_IPropertySheet( self ):
-
-        from Products.PluggableAuthService.interfaces.propertysheets \
-            import IPropertySheet
-
-        from Interface.Verify import verifyClass
-
-        verifyClass( IPropertySheet, self._getTargetClass() )
-
     def test_ctor_id_noscehma_novalues( self ):
 
         ups = self._makeOne( 'empty' )

_______________________________________________
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.