[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testPrincipalPermissionManager.py:1.1.2.5
Anthony Baxter
anthony@interlink.com.au
Fri, 8 Feb 2002 12:12:57 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv17588
Modified Files:
Tag: Zope-3x-branch
testPrincipalPermissionManager.py
Log Message:
renamed pregistry and xregistry to more meaningful names.
=== Zope3/lib/python/Zope/App/Security/tests/testPrincipalPermissionManager.py 1.1.2.4 => 1.1.2.5 ===
from Zope.App.Security.PermissionRegistry \
- import permissionRegistry as pregistry
-from Zope.App.Security.PrincipalRegistry import principalRegistry as xregistry
+ import permissionRegistry as permregistry
+from Zope.App.Security.PrincipalRegistry \
+ import principalRegistry as prinregistry
from Zope.App.Security.PrincipalPermissionManager \
- import principalPermissionManager as manager
+ import principalPermissionManager as manager
class Test(unittest.TestCase):
def tearDown(self):
- pregistry._clear()
- xregistry._clear()
+ permregistry._clear()
+ prinregistry._clear()
manager._clear()
def _make_principal(self, id=None, title=None):
- xregistry.definePrincipal(
+ prinregistry.definePrincipal(
id or 'APrincipal',
title or 'A Principal',
login = id or 'APrincipal')
@@ -34,13 +35,13 @@
def testUnboundPrincipalPermission(self):
- permission = pregistry.definePermission('APerm', 'title')
+ permission = permregistry.definePermission('APerm', 'title')
principal = self._make_principal()
self.assertEqual(manager.getPrincipalsForPermission(permission), [])
self.assertEqual(manager.getPermissionsForPrincipal(principal), [])
def testPrincipalPermission(self):
- permission = pregistry.definePermission('APerm', 'title')
+ permission = permregistry.definePermission('APerm', 'title')
principal = self._make_principal()
manager.grantPermissionToPrincipal(permission, principal)
self.assertEqual(manager.getPrincipalsForPermission(permission),
@@ -49,8 +50,8 @@
[permission])
def testManyPermissionsOnePrincipal(self):
- perm1 = pregistry.definePermission('Perm One', 'title')
- perm2 = pregistry.definePermission('Perm Two', 'title')
+ perm1 = permregistry.definePermission('Perm One', 'title')
+ perm2 = permregistry.definePermission('Perm Two', 'title')
prin1 = self._make_principal()
manager.grantPermissionToPrincipal(perm1, prin1)
manager.grantPermissionToPrincipal(perm2, prin1)
@@ -60,7 +61,7 @@
self.failUnless(perm2 in perms)
def testManyPrincipalsOnePermission(self):
- perm1 = pregistry.definePermission('Perm One', 'title').getId()
+ perm1 = permregistry.definePermission('Perm One', 'title').getId()
prin1 = self._make_principal()
prin2 = self._make_principal('Principal 2', 'Principal Two')
manager.grantPermissionToPrincipal(perm1, prin1)