[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_configurations.py:1.4

Jim Fulton jim@zope.com
Fri, 21 Mar 2003 16:05:59 -0500


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

Modified Files:
	test_configurations.py 
Log Message:
Refactoried the class hierarchy to separate component
management from named registration.

Introducted a new simple componentPath field.


=== Zope3/src/zope/app/services/tests/test_configurations.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/services/tests/test_configurations.py:1.3	Wed Feb 26 11:11:37 2003
+++ Zope3/src/zope/app/services/tests/test_configurations.py	Fri Mar 21 16:05:59 2003
@@ -23,7 +23,7 @@
         import Active, Registered, Unregistered
 from zope.app.interfaces.dependable import DependencyError
 from zope.app.services.configuration import SimpleConfiguration
-from zope.app.services.configuration import NamedComponentConfiguration
+from zope.app.services.configuration import ComponentConfiguration
 from zope.app.services.tests.placefulsetup \
         import PlacefulSetup
 from zope.app.services.tests.servicemanager \
@@ -78,7 +78,7 @@
         self.assertEquals(cfg.status, Unregistered)
 
 
-class TestNamedComponentConfiguration(TestSimpleConfiguration, PlacefulSetup):
+class TestComponentConfiguration(TestSimpleConfiguration, PlacefulSetup):
 
     def setUp(self):
         PlacefulSetup.setUp(self)
@@ -92,7 +92,7 @@
         path, component = 'foo', object()
         self.rootFolder.setObject(path, component)
         # set up a configuration
-        cfg = NamedComponentConfiguration(self.name, path)
+        cfg = ComponentConfiguration(path)
         cfg = ContextWrapper(cfg, self.rootFolder)
         # check that getComponent finds the configuration
         self.assertEquals(cfg.getComponent(), component)
@@ -102,7 +102,7 @@
         path, component = 'foo', object()
         self.rootFolder.setObject(path, component)
         # set up a configuration
-        cfg = NamedComponentConfiguration(self.name, path, 'zope.TopSecret')
+        cfg = ComponentConfiguration(path, 'zope.TopSecret')
         cfg.getInterface = lambda: ITestComponent
         cfg = ContextWrapper(cfg, self.rootFolder)
         # check that getComponent finds the configuration
@@ -115,7 +115,7 @@
         path, component = 'foo', ComponentStub()
         self.rootFolder.setObject(path, component)
         # set up a configuration
-        cfg = NamedComponentConfiguration(self.name, path)
+        cfg = ComponentConfiguration(path)
         self.rootFolder.setObject('cfg', cfg)
         cfg = traverse(self.rootFolder, 'cfg')
         # simulate IAddNotifiable
@@ -129,7 +129,7 @@
         self.rootFolder.setObject(path, component)
         component.addDependent('/cfg')
         # set up a configuration
-        cfg = NamedComponentConfiguration(self.name, path)
+        cfg = ComponentConfiguration(path)
         cfg.status = Unregistered
         self.rootFolder.setObject('cfg', cfg)
         cfg = traverse(self.rootFolder, 'cfg')
@@ -145,7 +145,7 @@
 def test_suite():
     return TestSuite((
         makeSuite(TestSimpleConfiguration),
-        makeSuite(TestNamedComponentConfiguration),
+        makeSuite(TestComponentConfiguration),
         ))
 
 if __name__=='__main__':