[Zope3-checkins] CVS: Zope3/src/zope/app/component/tests -
test_contentdirective.py:1.5 test_directives.py:1.13
test_factory.py:1.6 test_requirepermissions.py:1.7
test_servicedirective.py:1.9
Philipp von Weitershausen
philikon at philikon.de
Sat Aug 2 23:13:51 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/component/tests
In directory cvs.zope.org:/tmp/cvs-serv23732/component/tests
Modified Files:
test_contentdirective.py test_directives.py test_factory.py
test_requirepermissions.py test_servicedirective.py
Log Message:
Here we go again. All tests have been run twice and passed. Sorry again for
the trouble I've caused. Anthony and Steve, I owe you guys are beer.
Converted the three most important packages that define ZCML directives
to the new ZCML architecture (using schemas):
- zope.app.component
- zope.app.browser.form
- zope.app.publisher.browser
=== Zope3/src/zope/app/component/tests/test_contentdirective.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/component/tests/test_contentdirective.py:1.4 Sat Aug 2 05:11:18 2003
+++ Zope3/src/zope/app/component/tests/test_contentdirective.py Sat Aug 2 22:13:13 2003
@@ -162,7 +162,7 @@
<content class="zope.app.component.tests.exampleclass.ExampleClass">
<factory
id="Example"
- permission="UndefinedPermission"
+ permission="zope.UndefinedPermission"
title="Example content"
description="Example description"
/>
=== Zope3/src/zope/app/component/tests/test_directives.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/component/tests/test_directives.py:1.12 Sat Aug 2 05:11:18 2003
+++ Zope3/src/zope/app/component/tests/test_directives.py Sat Aug 2 22:13:13 2003
@@ -132,7 +132,7 @@
factory="zope.component.tests.components.Comp"
provides="zope.component.tests.components.IApp"
for="zope.component.tests.components.IContent"
- permission="UndefinedPermission"
+ permission="zope.UndefinedPermission"
/>
"""
))
@@ -224,7 +224,7 @@
<utility
component="zope.component.tests.components.comp"
provides="zope.component.tests.components.IApp"
- permission="UndefinedPermission"
+ permission="zope.UndefinedPermission"
/>
"""
))
@@ -341,7 +341,7 @@
factory="zope.component.tests.views.V1"
for="zope.component.tests.views.IC"
type="zope.component.tests.views.IV"
- permission="UndefinedPermission"
+ permission="zope.UndefinedPermission"
allowed_attributes="action index"
allowed_interface="zope.component.tests.views.IV"
/>
@@ -436,7 +436,7 @@
<resource name="test"
factory="zope.component.tests.views.R1"
type="zope.component.tests.views.IV"
- permission="UndefinedPermission"/>
+ permission="zope.UndefinedPermission"/>
"""
))
self.assertRaises(UndefinedPermissionError, xmlconfig, config,
@@ -479,18 +479,11 @@
id="foo"
component="zope.component.tests.factory.f"
/>
- <factory
- component="zope.component.tests.factory.f"
- />
"""
)))
from zope.component.tests.factory import X
self.assertEqual(createObject(None, 'foo').__class__, X)
- self.assertEqual(createObject(
- None,
- 'zope.component.tests.factory.f').__class__, X)
-
def test_suite():
return unittest.makeSuite(Test)
=== Zope3/src/zope/app/component/tests/test_factory.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/component/tests/test_factory.py:1.5 Sat Aug 2 05:11:18 2003
+++ Zope3/src/zope/app/component/tests/test_factory.py Sat Aug 2 22:13:13 2003
@@ -29,10 +29,10 @@
from zope.app.component.tests.exampleclass import ExampleClass
def configfile(s):
- return StringIO("""<zopeConfigure
+ return StringIO("""<configure
xmlns='http://namespaces.zope.org/zope'>
%s
- </zopeConfigure>
+ </configure>
""" % s)
class Test(PlacelessSetup, unittest.TestCase):
@@ -42,7 +42,6 @@
XMLConfig('meta.zcml', zope.app.component)()
XMLConfig('meta.zcml', zope.app.security)()
-
def testFactory(self):
from zope.component import getService
from zope.proxy import removeAllProxies
@@ -61,26 +60,6 @@
obj = getService(None, Factories).createObject('Example')
obj = removeAllProxies(obj)
self.failUnless(isinstance(obj, ExampleClass))
-
- def testFactoryDefaultId(self):
- from zope.component import getService
- from zope.proxy import removeAllProxies
- f = configfile("""
-<permission id="zope.Foo" title="Zope Foo Permission" />
-<content class="zope.app.component.tests.exampleclass.ExampleClass">
- <factory
- permission="zope.Foo"
- title="Example content"
- description="Example description"
- />
-</content>
- """)
- xmlconfig(f)
- obj = getService(None, Factories).createObject(
- 'zope.app.component.tests.exampleclass.ExampleClass')
- obj = removeAllProxies(obj)
- self.failUnless(isinstance(obj, ExampleClass))
-
def test_suite():
loader=unittest.TestLoader()
=== Zope3/src/zope/app/component/tests/test_requirepermissions.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/component/tests/test_requirepermissions.py:1.6 Sat Aug 2 16:05:26 2003
+++ Zope3/src/zope/app/component/tests/test_requirepermissions.py Sat Aug 2 22:13:13 2003
@@ -33,16 +33,16 @@
def defineDirectives():
XMLConfig('meta.zcml', zope.app.component)()
XMLConfig('meta.zcml', zope.app.security)()
- xmlconfig(StringIO("""<zopeConfigure
+ xmlconfig(StringIO("""<configure
xmlns='http://namespaces.zope.org/zope' >
- <permission id="zope.extravagant" title="extravagant" />
- <permission id="zope.paltry" title="paltry" />
- </zopeConfigure>"""))
+ <permission id="zope.Extravagant" title="extravagant" />
+ <permission id="zope.Paltry" title="paltry" />
+ </configure>"""))
NOTSET = []
-P1 = "zope.extravagant"
-P2 = "zope.paltry"
+P1 = "zope.Extravagant"
+P2 = "zope.Paltry"
class Test(PlacelessSetup, unittest.TestCase):
=== Zope3/src/zope/app/component/tests/test_servicedirective.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/component/tests/test_servicedirective.py:1.8 Sat Aug 2 05:11:18 2003
+++ Zope3/src/zope/app/component/tests/test_servicedirective.py Sat Aug 2 22:13:13 2003
@@ -26,13 +26,11 @@
from zope.component import getService
from zope.app.tests.placelesssetup import PlacelessSetup
-
-template = """<zopeConfigure
+template = """<configure
xmlns='http://namespaces.zope.org/zope'
xmlns:test='http://www.zope.org/NS/Zope3/test'>
%s
- </zopeConfigure>"""
-
+ </configure>"""
class Test(PlacelessSetup, unittest.TestCase):
@@ -161,7 +159,7 @@
zope.app.security.registries.metaconfigure.definePermission" />
</directives>
- <permission id="XXX" title="xxx" />
+ <permission id="zope.TestPermission" title="Test permission" />
<serviceType id="Foo"
interface="
@@ -171,7 +169,7 @@
serviceType="Foo"
component="
zope.app.component.tests.service.fooService"
- permission="XXX"
+ permission="zope.TestPermission"
/>
"""
)))
More information about the Zope3-Checkins
mailing list