[Zope-Checkins] CVS: Zope3/lib/python/Zope/Configuration/tests - testDirectivesXML.py:1.1.2.7.8.1
Steve Alexander
steve@cat-box.net
Sat, 1 Jun 2002 04:35:55 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Configuration/tests
In directory cvs.zope.org:/tmp/cvs-serv4086/lib/python/Zope/Configuration/tests
Modified Files:
Tag: Zope3InWonderland-branch
testDirectivesXML.py
Log Message:
added handler_method attribute to subdirectives to explicitly say
what method of a directive handler class will process them.
=== Zope3/lib/python/Zope/Configuration/tests/testDirectivesXML.py 1.1.2.7 => 1.1.2.7.8.1 ===
class Test(CleanUp, unittest.TestCase):
- def testDirective(self):
+ def xtestDirective(self):
xmlconfig(StringIO(
template % (
'''<directives namespace="%s">
@@ -42,7 +42,7 @@
self.assertEqual(done, ['splat'])
- def testSimpleComplexDirective(self):
+ def xtestSimpleComplexDirective(self):
xmlconfig(StringIO(
template % (
'''<directives namespace="%s">
@@ -78,6 +78,28 @@
(".Contact", "edit", 'update'),
(".Contact", "view", 'name, email'),
])
+
+ def testHandlerMethod(self):
+ xmlconfig(StringIO(
+ template % (
+ '''<directives namespace="%s">
+ <directive name="protectClass"
+ handler="Zope.Configuration.tests.Directives.protectClass">
+ <subdirective name="fish"
+ handler_method="protect" />
+ </directive>
+ </directives>''' % ns,
+ '''<test:protectClass name=".Contact">
+ <test:fish permission="edit" names='update' />
+ <test:fish permission="view" names='name, email' />
+ </test:protectClass>'''
+ )))
+
+ self.assertEquals(protections, [
+ (".Contact", "edit", 'update'),
+ (".Contact", "view", 'name, email'),
+ ])
+
def testBadNoPrefixComplexDirective(self):