Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add another helper method in the tests.

  • Loading branch information...
commit 2604444b58132e5e900067a54ba8c64c37d7b760 1 parent c7ca70d
Maurits van Rees mauritsvanrees authored
Showing with 13 additions and 18 deletions.
  1. +13 −18 Products/PloneLDAP/tests/testInterfaces.py
31 Products/PloneLDAP/tests/testInterfaces.py
View
@@ -86,41 +86,36 @@ def _testUserManagement(self, klass):
self.assertTrue(hasattr(klass, 'doChangeUser'))
self.assertTrue(hasattr(klass, 'doDeleteUser'))
+ def _verify(self, iface, klass):
+ if iface.implementedBy(klass):
+ self.assertTrue(verifyClass(iface, klass))
+
def _testAuthentication(self, klass):
- if IAuthenticationPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(IAuthenticationPlugin, klass))
+ self._verify(IAuthenticationPlugin, klass)
def _testRoles(self, klass):
- if IRolesPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(IRolesPlugin, klass))
+ self._verify(IRolesPlugin, klass)
def _testCredentialsReset(self, klass):
- if ICredentialsResetPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(ICredentialsResetPlugin, klass))
+ self._verify(ICredentialsResetPlugin, klass)
def _testProperties(self, klass):
- if IPropertiesPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(IPropertiesPlugin, klass))
+ self._verify(IPropertiesPlugin, klass)
def _testGroupEnumeration(self, klass):
- if IGroupEnumerationPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(IGroupEnumerationPlugin, klass))
+ self._verify(IGroupEnumerationPlugin, klass)
def _testUserEnumeration(self, klass):
- if IUserEnumerationPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(IUserEnumerationPlugin, klass))
+ self._verify(IUserEnumerationPlugin, klass)
def _testGroups(self, klass):
- if IGroupsPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(IGroupsPlugin, klass))
+ self._verify(IGroupsPlugin, klass)
def _testRoleEnumeration(self, klass):
- if IRoleEnumerationPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(IRoleEnumerationPlugin, klass))
+ self._verify(IRoleEnumerationPlugin, klass)
def _testUserAdder(self, klass):
- if IUserAdderPlugin.implementedBy(klass):
- self.assertTrue(verifyClass(IUserAdderPlugin, klass))
+ self._verify(IUserAdderPlugin, klass)
def testPluginBaseMixin(self):
klass = PloneLDAPPluginBaseMixin
Please sign in to comment.
Something went wrong with that request. Please try again.