[Zope3-checkins] CVS: Zope3/src/zope/app/security/registries/tests - test_permissionregistry.py:1.1.2.2 test_principalregistry.py:1.1.2.2 test_roleregistry.py:1.1.2.2
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:48 -0500
Update of /cvs-repository/Zope3/src/zope/app/security/registries/tests
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/app/security/registries/tests
Modified Files:
Tag: NameGeddon-branch
test_permissionregistry.py test_principalregistry.py
test_roleregistry.py
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py. The
files are fixed-points of that script now. Fixed a few cases where
code relied on significant trailing whitespace (ouch).
=== Zope3/src/zope/app/security/registries/tests/test_permissionregistry.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/registries/tests/test_permissionregistry.py:1.1.2.1 Mon Dec 23 14:32:21 2002
+++ Zope3/src/zope/app/security/registries/tests/test_permissionregistry.py Tue Dec 24 21:20:47 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
""" Test handler for 'definePermission' directive
@@ -26,11 +26,11 @@
from zope.testing.cleanup import CleanUp # Base class w registry cleanup
class Test(CleanUp, unittest.TestCase):
-
+
def testEmptyPermissions(self):
self.assertEqual(None, permissionRegistry.getPermission('Foo'))
self.failIf(permissionRegistry.definedPermission('Foo'))
-
+
def testPermissionStartsWithDot(self):
self.assertRaises(ValueError, permissionRegistry.definePermission,
'.Foo', 'dot foo title')
@@ -53,7 +53,7 @@
permission = permissionRegistry.getPermission('Foo')
eq(permission.getTitle(), 'Foo-able')
eq(permission.getDescription(), '')
-
+
def testDefinePermissionWithTitleAndDescription(self):
eq = self.assertEqual
permissionRegistry.definePermission('Foo', 'Foo-able',
@@ -70,7 +70,7 @@
self.assertRaises(UndefinedPermissionError,
permissionRegistry.ensurePermissionDefined,
'Foo.Bar.Spam.Undefined')
-
+
def test_suite():
loader=unittest.TestLoader()
=== Zope3/src/zope/app/security/registries/tests/test_principalregistry.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/registries/tests/test_principalregistry.py:1.1.2.1 Mon Dec 23 14:32:21 2002
+++ Zope3/src/zope/app/security/registries/tests/test_principalregistry.py Tue Dec 24 21:20:48 2002
@@ -9,7 +9,7 @@
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
import unittest, sys
@@ -70,11 +70,11 @@
self.assertRaises(NotFoundError, self.reg.getPrincipal, '3')
def testDup(self):
- self.assertRaises(DuplicateId,
+ self.assertRaises(DuplicateId,
self.reg.definePrincipal,
'1', 'Tim Peters', 'Sir Tim Peters',
'tim2', '123')
- self.assertRaises(DuplicateLogin,
+ self.assertRaises(DuplicateLogin,
self.reg.definePrincipal,
'3', 'Tim Peters', 'Sir Tim Peters',
'tim', '123')
=== Zope3/src/zope/app/security/registries/tests/test_roleregistry.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/registries/tests/test_roleregistry.py:1.1.2.1 Mon Dec 23 14:32:21 2002
+++ Zope3/src/zope/app/security/registries/tests/test_roleregistry.py Tue Dec 24 21:20:48 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
""" Test handler for 'defineRole' directive """
@@ -21,7 +21,7 @@
from zope.testing.cleanup import CleanUp # Base class w registry cleanup
class Test(CleanUp, unittest.TestCase):
-
+
def testEmptyRoles(self):
self.assertEqual(None, roleRegistry.getRole('Foo'))
self.failIf(roleRegistry.definedRole('Foo'))
@@ -44,14 +44,14 @@
role = roleRegistry.getRole(r.getId())
eq(role.getTitle(), 'Foo-able')
eq(role.getDescription(), '')
-
+
def testDefineRoleWithTitleAndDescription(self):
eq = self.assertEqual
r = roleRegistry.defineRole('Foo', 'Foo-able', 'A foo-worthy role')
role = roleRegistry.getRole(r.getId())
eq(role.getTitle(), 'Foo-able')
eq(role.getDescription(), 'A foo-worthy role')
-
+
def test_suite():
loader=unittest.TestLoader()