[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testPermissionRegistry.py:1.1.2.12 testRoleRegistry.py:1.1.2.7 testSecurityManagement.py:1.1.2.10 testSecurityManager.py:1.1.2.8
Jim Fulton
jim@zope.com
Tue, 5 Mar 2002 16:43:21 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv2132/Zope/App/Security/tests
Modified Files:
Tag: Zope-3x-branch
testPermissionRegistry.py testRoleRegistry.py
testSecurityManagement.py testSecurityManager.py
Log Message:
Hold on to your butts!
Major refactoring of Interface package to clean up the interfaces and
module structure.
Note especially, to verify interface implementstions,
use verifyObject or verifyClass from the Interface.Verify module:
from Interface.Verify import verifyClass
verifyClass(ISomeInterface, SomeClass)
=== Zope3/lib/python/Zope/App/Security/tests/testPermissionRegistry.py 1.1.2.11 => 1.1.2.12 ===
from Zope.App.Security.PermissionRegistry import permissionRegistry
from Zope.App.Security.IPermission import IPermission
-from Interface.verify import verify
+from Interface.Verify import verifyObject
from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
class Test(CleanUp, unittest.TestCase):
@@ -31,11 +31,11 @@
def testPermissionIsAnIPermission(self):
permissionRegistry.definePermission('Foo', 'foo title')
permission = permissionRegistry.getPermission('Foo')
- self.assertEqual(verify(IPermission, permission), 1)
+ self.assertEqual(verifyObject(IPermission, permission), 1)
def testDefinePermission(self):
perm = permissionRegistry.definePermission('Foo', 'foo title')
- self.failUnless(verify(IPermission, perm))
+ self.failUnless(verifyObject(IPermission, perm))
self.failUnless(permissionRegistry.definedPermission('Foo'))
permission = permissionRegistry.getPermission('Foo')
self.assertEquals(permission.getTitle(), 'foo title')
=== Zope3/lib/python/Zope/App/Security/tests/testRoleRegistry.py 1.1.2.6 => 1.1.2.7 ===
from Zope.App.Security.RoleRegistry import roleRegistry
from Zope.App.Security.IRole import IRole
-from Interface.verify import verify
+from Interface.Verify import verifyObject
from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
class Test(CleanUp, unittest.TestCase):
@@ -25,11 +25,11 @@
def testRoleIsAnIRole(self):
r = roleRegistry.defineRole('Foo', 'Foo role')
role = roleRegistry.getRole(r.getId())
- self.assertEqual(verify(IRole, role), 1)
+ self.assertEqual(verifyObject(IRole, role), 1)
def testDefineRole(self):
role = roleRegistry.defineRole('Foo', 'foo role')
- self.failUnless(verify(IRole, role))
+ self.failUnless(verifyObject(IRole, role))
self.failUnless(roleRegistry.definedRole(role.getId()))
role = roleRegistry.getRole(role.getId())
self.assertEquals(role.getTitle(), 'foo role')
=== Zope3/lib/python/Zope/App/Security/tests/testSecurityManagement.py 1.1.2.9 => 1.1.2.10 ===
"""
-
import unittest
-from Interface import verify
+from Interface.Verify import verifyObject
import Zope.App.Security.SecurityManagement
from Zope.App.Security.SecurityManagement import \
@@ -40,8 +39,8 @@
from Zope.App.Security.ISecurityManagement \
import ISecurityManagementSetup
- verify( ISecurityManagementSetup, SecurityManagement )
- verify( ISecurityManagement, SecurityManagement )
+ verifyObject( ISecurityManagementSetup, SecurityManagement )
+ verifyObject( ISecurityManagement, SecurityManagement )
def test_ISecurityManagementSetup( self ):
=== Zope3/lib/python/Zope/App/Security/tests/testSecurityManager.py 1.1.2.7 => 1.1.2.8 ===
import unittest
-from Interface import verify
+from Interface.Verify import verifyClass
from Zope.App.Security import SecurityManager
from Zope.App.Security.SimpleSecurityPolicies import \
@@ -59,7 +59,7 @@
from Zope.App.Security.SecurityManager import SecurityManager
from Zope.App.Security.ISecurityManager import ISecurityManager
- verify( ISecurityManager, SecurityManager )
+ verifyClass( ISecurityManager, SecurityManager )
def test_empty( self ):