[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI/tests - testServiceProvideClass.py:1.1.2.7

Stephan Richter srichter@cbu.edu
Tue, 2 Apr 2002 17:24:56 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI/tests
In directory cvs.zope.org:/tmp/cvs-serv20267/lib/python/Zope/App/ZMI/tests

Modified Files:
      Tag: Zope-3x-branch
	testServiceProvideClass.py 
Log Message:
Issue 54: Resolve

Cleaned up the ZMI namespace quiet a bit:

- Removed the deprecated provideClass directive from the Code.
- Added "class" attribute to factoryFromClass to the "zmi" and "service" 
  namespace.
- Changed existing directives to reflect this change.
- Corrected tests. 



=== Zope3/lib/python/Zope/App/ZMI/tests/testServiceProvideClass.py 1.1.2.6 => 1.1.2.7 ===
             'Zope.App.ZMI.tests.testServiceProvideClass.MyAddableService')
         
-        xmlconfig( StringIO("""
+        xmlconfig( StringIO('''
         <zopeConfigure
-        xmlns='http://namespaces.zope.org/zope'
-        xmlns:service='http://namespaces.zope.org/zmi/service'>
+        xmlns="http://namespaces.zope.org/zope"
+        xmlns:service="http://namespaces.zope.org/zmi/service">
 
         <directives namespace="http://namespaces.zope.org/zmi/service">
-          <directive name="provideClass"
+          <directive name="factoryFromClass"
             attributes="name, permission_id, title, description"
-            handler="Zope.App.ZMI.provideClass.ServiceClassDir" />
+            handler="Zope.App.ZMI.metaConfigure.ServiceClassDir" />
         </directives>
 
-        <service:provideClass name="%s"
+        <service:factoryFromClass name="%s"
+                 class="%s"
                  permission_id="Zope.AddService"
                  title="Stupid Service"
                  description="This is a sample Service" />
       
         </zopeConfigure>        
-        """ % serviceName))
+        ''' %(serviceName, serviceName)))
 
         addables = ServiceAddables.getAddables(None)
         self.assertEqual(addables[0].id(), serviceName)