[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_field.py:1.6

Guido van Rossum guido@python.org
Thu, 13 Mar 2003 12:11:08 -0500


Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv17382/src/zope/app/services/tests

Modified Files:
	test_field.py 
Log Message:
- Remove title and description fields from add_cache.pt (these
  attributes no longer exist on configurations).

- Changed the custom view for adding a connection configuration with
  an add form directive; addconnectionconfig.pt and connection.py in
  zope/app/browser/services bite the dust.

- Change the componentPath attribute to a ComponentPath field; this
  ran into some circularities so we did the following:

- Renamed INameResolver to IModuleService and moved it to its own
  file, zope/app/interfaces/services/module.py.

- Fixed up a few docstrings and comments.



=== Zope3/src/zope/app/services/tests/test_field.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/services/tests/test_field.py:1.5	Sun Jan 12 16:23:16 2003
+++ Zope3/src/zope/app/services/tests/test_field.py	Thu Mar 13 12:10:37 2003
@@ -22,12 +22,13 @@
 from zope.schema.interfaces import ValidationError
 from zope.interface import Interface
 
-from zope.app.interfaces.services.service import INameResolver
+from zope.app.interfaces.services.module import IModuleService
 from zope.component.interfaces import IServiceService
-class NameResolver:
-    __implements__ = INameResolver, IServiceService
+
+class ModuleService:
+    __implements__ = IModuleService, IServiceService
     # I'm lying about implementing IServiceService, but that is needed to get
-    # a NameResolver as a service manager
+    # a ModuleService as a service manager.  (See XXX comment in module.py.)
     def __init__(self, name=None, component=None):
         self.lookup = {}
         if name is not None:
@@ -80,7 +81,7 @@
 
     def createObjects(self):
         TestComponentPath.createObjects(self)
-        self.resolver = NameResolver()
+        self.resolver = ModuleService()
         self.rootFolder.setServiceManager(self.resolver)
 
     def createFields(self):
@@ -123,7 +124,7 @@
 
         dotted_name = 'zope.app.whatever.ClassName'
         some_class = self.__class__
-        resolver = NameResolver(dotted_name, some_class)
+        resolver = ModuleService(dotted_name, some_class)
         self.rootFolder.setServiceManager(resolver)
         self.assertEqual(locateComponent(dotted_name, folder2),
                          some_class