[Erp5-report] r8797 - /erp5/trunk/products/ERP5Security/tests/testERP5Security.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jul 26 14:38:45 CEST 2006


Author: jerome
Date: Wed Jul 26 14:38:41 2006
New Revision: 8797

URL: http://svn.erp5.org?rev=8797&view=rev
Log:
use verifyClass to check interfaces conformance


Modified:
    erp5/trunk/products/ERP5Security/tests/testERP5Security.py

Modified: erp5/trunk/products/ERP5Security/tests/testERP5Security.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Security/tests/testERP5Security.py?rev=8797&r1=8796&r2=8797&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Security/tests/testERP5Security.py (original)
+++ erp5/trunk/products/ERP5Security/tests/testERP5Security.py Wed Jul 26 14:38:41 2006
@@ -41,6 +41,10 @@
 from zLOG import LOG
 from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
 from Products.PluggableAuthService import PluggableAuthService
+try:
+    from zope.interface.verify import verifyClass
+except ImportError:
+    from Interface.Verify import verifyClass
 
 class TestERP5Security(ERP5TypeTestCase):
   """Test invoice are created from orders then packing lists. """
@@ -62,11 +66,31 @@
     user = uf.getUserById('alex').__of__(uf)
     newSecurityManager(None, user)
   
-  def test_Interfaces(self, run=RUN_ALL_TESTS):
-    """Tests plugins respects interfaces they declare."""
-    # TODO
+  def test_GroupManagerInterfaces(self, run=RUN_ALL_TESTS):
+    """Tests group manager pluign respects interfaces."""
     if not run:
       return
+    from Products.PluggableAuthService.interfaces.plugins import IGroupsPlugin
+    from Products.ERP5Security.ERP5GroupManager import ERP5GroupManager
+    verifyClass(IGroupsPlugin, ERP5GroupManager)
+
+  def test_UserManagerInterfaces(self, run=RUN_ALL_TESTS):
+    """Tests user manager pluign respects interfaces."""
+    if not run:
+      return
+    from Products.PluggableAuthService.interfaces.plugins import\
+                IAuthenticationPlugin, IUserEnumerationPlugin
+    from Products.ERP5Security.ERP5UserManager import ERP5UserManager
+    verifyClass(IAuthenticationPlugin, ERP5UserManager)
+    verifyClass(IUserEnumerationPlugin, ERP5UserManager)
+
+  def test_RolesManagerInterfaces(self, run=RUN_ALL_TESTS):
+    """Tests group manager pluign respects interfaces."""
+    if not run:
+      return
+    from Products.PluggableAuthService.interfaces.plugins import IRolesPlugin
+    from Products.ERP5Security.ERP5RoleManager import ERP5RoleManager
+    verifyClass(IRolesPlugin, ERP5RoleManager)
 
   def test_UserFolder(self, run=RUN_ALL_TESTS):
     """Tests user folder has correct meta type."""




More information about the Erp5-report mailing list