[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Publisher/XMLRPC/tests - testDirectives.py:1.3
Jim Fulton
jim@zope.com
Thu, 20 Jun 2002 11:55:29 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/Publisher/XMLRPC/tests
In directory cvs.zope.org:/tmp/cvs-serv15462/lib/python/Zope/App/Publisher/XMLRPC/tests
Modified Files:
testDirectives.py
Log Message:
implemented:
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/MergeSecurityIntoZopeNamespace
While I was at it, I couldn't resist implementing a variation of:
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/SecurityPackageReorg
which was a lot more work.
=== Zope3/lib/python/Zope/App/Publisher/XMLRPC/tests/testDirectives.py 1.2 => 1.3 ===
$Id$
"""
-import os
+
import unittest
-import sys
-from Zope.Configuration.xmlconfig import xmlconfig
+from Zope.Configuration.xmlconfig import xmlconfig, XMLConfig
from Zope.Configuration.Exceptions import ConfigurationError
from Zope.ComponentArchitecture.tests.TestViews import IC, V1, VZMI, R1, RZMI
from Zope.ComponentArchitecture import getView, queryView
@@ -34,13 +33,8 @@
import Zope.App.Publisher.XMLRPC
-defs_path = os.path.join(
- os.path.split(Zope.App.Publisher.XMLRPC.__file__)[0],
- 'meta.zcml')
-
template = """<zopeConfigure
xmlns='http://namespaces.zope.org/zope'
- xmlns:security='http://namespaces.zope.org/security'
xmlns:xmlrpc='http://namespaces.zope.org/xmlrpc'>
%s
</zopeConfigure>"""
@@ -56,7 +50,7 @@
def setUp(self):
PlacelessSetup.setUp(self)
- xmlconfig(open(defs_path))
+ XMLConfig('meta.zcml', Zope.App.Publisher.XMLRPC)()
def testView(self):
self.assertEqual(queryView(ob, 'test', request),
@@ -232,13 +226,14 @@
xmlconfig(StringIO(template %
"""
- <directives namespace="http://namespaces.zope.org/security">
+ <directives namespace="http://namespaces.zope.org/zope">
<directive name="permission"
attributes="id title description"
- handler="Zope.App.Security.metaConfigure.definePermission" />
+ handler="
+ Zope.App.Security.Registries.metaConfigure.definePermission" />
</directives>
- <security:permission id="XXX" title="xxx" />
+ <permission id="XXX" title="xxx" />
<xmlrpc:view
factory="Zope.ComponentArchitecture.tests.TestViews.V1"