[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/component/tests/test_servicedirective.py Fix test, now that the old way of defining directives is gone.

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Jul 13 19:47:28 EDT 2004


Log message for revision 26515:
  Fix test, now that the old way of defining directives is gone.
  


Changed:
  U   Zope3/trunk/src/zope/app/component/tests/test_servicedirective.py


-=-
Modified: Zope3/trunk/src/zope/app/component/tests/test_servicedirective.py
===================================================================
--- Zope3/trunk/src/zope/app/component/tests/test_servicedirective.py	2004-07-13 23:25:04 UTC (rev 26514)
+++ Zope3/trunk/src/zope/app/component/tests/test_servicedirective.py	2004-07-13 23:47:28 UTC (rev 26515)
@@ -60,13 +60,12 @@
             UndefinedService,
             xmlconfig,
             StringIO(template % (
-            """
+            '''
             <service
-              serviceType="Foo"
-              component="
-              zope.app.component.tests.service.fooService"
-              />
-            """
+                serviceType="Foo"
+                component="zope.app.component.tests.service.fooService"
+                />
+            '''
             )))
 
     def testDuplicateServiceConfig(self):
@@ -74,39 +73,36 @@
             ConfigurationConflictError,
             xmlconfig,
             StringIO(template % (
-            """
-            <serviceType id="Foo"
-                         interface="
-               zope.app.component.tests.service.IFooService"
-               />
+            '''
+            <serviceType
+                id="Foo"
+                interface="zope.app.component.tests.service.IFooService"
+                />
             <service
               serviceType="Foo"
-              component="
-              zope.app.component.tests.service.fooService"
+              component="zope.app.component.tests.service.fooService"
               />
             <service
               serviceType="Foo"
-              component="
-              zope.app.component.tests.service.foo2"
+              component="zope.app.component.tests.service.foo2"
               />
-            """
+            '''
             )))
 
     def testServiceConfig(self):
         self.assertRaises(ComponentLookupError, getService, "Foo")
 
         xmlconfig(StringIO(template % (
-            """
-            <serviceType id="Foo"
-                         interface="
-               zope.app.component.tests.service.IFooService"
-               />
+            '''
+            <serviceType
+                id="Foo"
+                interface="zope.app.component.tests.service.IFooService"
+                />
             <service
-              serviceType="Foo"
-              component="
-              zope.app.component.tests.service.fooService"
-              />
-            """
+                serviceType="Foo"
+                component="zope.app.component.tests.service.fooService"
+                />
+            '''
             )))
 
         service = getService("Foo")
@@ -118,17 +114,16 @@
         self.assertRaises(ComponentLookupError, getService, "Foo")
 
         xmlconfig(StringIO(template % (
-            """
-            <serviceType id="Foo"
-                         interface="
-               zope.app.component.tests.service.IFooService"
-               />
+            '''
+            <serviceType
+                id="Foo"
+                interface="zope.app.component.tests.service.IFooService"
+                />
             <service
-              serviceType="Foo"
-              factory="
-              zope.app.component.tests.service.FooService"
-              />
-            """
+                serviceType="Foo"
+                factory="zope.app.component.tests.service.FooService"
+                />
+            '''
             )))
 
         service = getService("Foo")
@@ -140,18 +135,17 @@
         self.assertRaises(ComponentLookupError, getService, "Foo")
 
         xmlconfig(StringIO(template % (
-            """
-            <serviceType id="Foo"
-                         interface="
-               zope.app.component.tests.service.IFooService"
-               />
+            '''
+            <serviceType
+                id="Foo"
+                interface="zope.app.component.tests.service.IFooService"
+                />
             <service
-              serviceType="Foo"
-              component="
-              zope.app.component.tests.service.fooService"
-              permission="zope.Public"
-              />
-            """
+                serviceType="Foo"
+                component="zope.app.component.tests.service.fooService"
+                permission="zope.Public"
+                />
+            '''
             )))
 
         service = getService("Foo")
@@ -164,30 +158,23 @@
         self.assertRaises(ComponentLookupError, getService, "Foo")
 
         xmlconfig(StringIO(template % (
-            """
-            <directives namespace="http://namespaces.zope.org/zope">
-              <directive name="permission"
-                 attributes="id title description"
-                 handler="
-              zope.app.security.metaconfigure.definePermission" />
-            </directives>
+            '''
+            <include package="zope.app.security" file="meta.zcml" />
 
             <permission id="zope.TestPermission" title="Test permission" />
 
-            <serviceType id="Foo"
-                         interface="
-               zope.app.component.tests.service.IFooService"
-               />
+            <serviceType
+                id="Foo"
+                interface="zope.app.component.tests.service.IFooService"
+                />
             <service
-              serviceType="Foo"
-              component="
-              zope.app.component.tests.service.fooService"
-              permission="zope.TestPermission"
-              />
-            """
+                serviceType="Foo"
+                component="zope.app.component.tests.service.fooService"
+                permission="zope.TestPermission"
+                />
+            '''
             )))
 
-
         # Need to "log someone in" to turn on checks
         from zope.security.management import newInteraction
         newInteraction(ParticipationStub('someuser'))



More information about the Zope3-Checkins mailing list