[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testProtectClass.py:1.1.2.10 testPublicClass.py:1.1.2.10 testSecurityDirectives.py:1.1.2.13
Steve Alexander
steve@cat-box.net
Sun, 10 Mar 2002 19:11:26 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv10945/lib/python/Zope/App/Security/tests
Modified Files:
Tag: Zope-3x-branch
testProtectClass.py testPublicClass.py
testSecurityDirectives.py
Log Message:
Changed zcml security syntax to remove the "method=" attribute, and allow
only the "methods=" attribute.
=== Zope3/lib/python/Zope/App/Security/tests/testProtectClass.py 1.1.2.9 => 1.1.2.10 ===
<directive namespace="http://namespaces.zope.org/security"
name="protectClass"
- attributes="name, permission, interface, method, methods"
+ attributes="name, permission, interface, methods"
handler="Zope.App.Security.protectClass.">
<subdirective namespace="http://namespaces.zope.org/security"
name="protect"
- attributes="permission, interface, method, methods" />
+ attributes="permission, interface, methods" />
<subdirective namespace="http://namespaces.zope.org/security"
name="instances"
attributes="permission" />
@@ -107,13 +107,6 @@
self.assertDeclaration,
declaration)
- def testSimpleMethod(self):
- declaration = ("""<security:protectClass
- name="%s" permission_id="%s" method="m1" />"""
- % (PREFIX+"test_class", P1))
- self.assertDeclaration(declaration,
- instP=P1, m1P=P1)
-
def testSimpleMethodsPlural(self):
declaration = ("""<security:protectClass
name="%s" permission_id="%s"
@@ -137,7 +130,7 @@
def testCompositeNoPerm(self):
"""Establish rejection of declarations lacking a permission spec."""
declaration = ("""<security:protectClass name="%s">
- <security:protect method="m1"/>
+ <security:protect methods="m1"/>
</security:protectClass>"""
% (PREFIX+"test_class"))
self.assertRaises(ZopeXMLConfigurationError,
@@ -146,7 +139,7 @@
# Permission not in top tag and in one subtag but not in the other:
declaration = ("""<security:protectClass name="%s">
<security:protect permission_id="%s"
- method="m1"/>
+ methods="m1"/>
<security:instances/>
</security:protectClass>"""
% (PREFIX+"test_class", P1))
@@ -156,7 +149,7 @@
def testCompositeMethodTopPerm(self):
declaration = ("""<security:protectClass name="%s" permission_id="%s">
- <security:protect method="m1"/>
+ <security:protect methods="m1"/>
</security:protectClass>"""
% (PREFIX+"test_class", P1))
self.assertDeclaration(declaration,
@@ -164,7 +157,7 @@
def testCompositeMethodElementPerm(self):
declaration = ("""<security:protectClass name="%s">
- <security:protect permission_id="%s" method="m1"/>
+ <security:protect permission_id="%s" methods="m1"/>
</security:protectClass>"""
% (PREFIX+"test_class", P1))
self.assertDeclaration(declaration,
=== Zope3/lib/python/Zope/App/Security/tests/testPublicClass.py 1.1.2.9 => 1.1.2.10 ===
<zopeConfigure xmlns='http://namespaces.zope.org/zope'>
<directive name="publicClass"
- attributes="name, interface, method, methods"
+ attributes="name, interface, methods"
namespace="http://namespaces.zope.org/security"
handler="Zope.App.Security.publicClass." />
</zopeConfigure>
@@ -88,7 +88,7 @@
declaration)
def testMethod(self):
- declaration = ("""<security:publicClass name="%s" method="m1" />"""
+ declaration = ("""<security:publicClass name="%s" methods="m1" />"""
% (PREFIX+"test_class"))
self.assertDeclaration(declaration,
instP=PublicPermission, m1P=PublicPermission)
=== Zope3/lib/python/Zope/App/Security/tests/testSecurityDirectives.py 1.1.2.12 => 1.1.2.13 ===
<directive namespace="http://namespaces.zope.org/security"
name="protectClass"
- attributes="name, permission, interface, method, methods"
+ attributes="name, permission, interface, methods"
handler="Zope.App.Security.protectClass.">
<subdirective namespace="http://namespaces.zope.org/security"
name="protect"
- attributes="permission, interface, method, methods" />
+ attributes="permission, interface, methods" />
<subdirective namespace="http://namespaces.zope.org/security"
name="instances"
attributes="permission" />
</directive>
<directive namespace="http://namespaces.zope.org/security"
name="publicClass"
- attributes="name, interface, method, methods"
+ attributes="name, interface, methods"
handler="Zope.App.Security.publicClass." />
<directive namespace="http://namespaces.zope.org/security"
name="defaultPolicy"