[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_configurationmanager.py:1.3 test_configurations.py:1.3 test_serviceconfiguration.py:1.3
Guido van Rossum
guido@python.org
Wed, 26 Feb 2003 11:11:37 -0500
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv30716/src/zope/app/services/tests
Modified Files:
test_configurationmanager.py test_configurations.py
test_serviceconfiguration.py
Log Message:
Rename manage_afterAdd and manage_beforeDelete to afterAddHook and
beforeDeleteHook. Patch contributed by Christian Heimes.
=== Zope3/src/zope/app/services/tests/test_configurationmanager.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/tests/test_configurationmanager.py:1.2 Wed Dec 25 09:13:20 2002
+++ Zope3/src/zope/app/services/tests/test_configurationmanager.py Wed Feb 26 11:11:37 2003
@@ -34,7 +34,7 @@
__implements__ = IDeleteNotifiable
- def manage_beforeDelete(self, object, container):
+ def beforeDeleteHook(self, object, container):
self.was_called = 1
@@ -339,7 +339,7 @@
manager = ConfigurationManager()
thingy = Undeletable()
manager.setObject('xyzzy', thingy)
- manager.manage_beforeDelete(manager, container)
+ manager.beforeDeleteHook(manager, container)
self.failUnless(thingy.was_called)
=== Zope3/src/zope/app/services/tests/test_configurations.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/tests/test_configurations.py:1.2 Wed Dec 25 09:13:20 2002
+++ Zope3/src/zope/app/services/tests/test_configurations.py Wed Feb 26 11:11:37 2003
@@ -62,19 +62,19 @@
class TestSimpleConfiguration(TestCase):
- def test_manage_beforeDelete(self):
+ def test_beforeDeleteHook(self):
container = object()
cfg = SimpleConfiguration()
# cannot delete an active configuration
cfg.status = Active
- self.assertRaises(DependencyError, cfg.manage_beforeDelete, cfg,
+ self.assertRaises(DependencyError, cfg.beforeDeleteHook, cfg,
container)
# deletion of a registered configuration causes it to become
# unregistered
cfg.status = Registered
- cfg.manage_beforeDelete(cfg, container)
+ cfg.beforeDeleteHook(cfg, container)
self.assertEquals(cfg.status, Unregistered)
@@ -110,7 +110,7 @@
self.assertEquals(result, component)
self.failUnless(type(result) is Proxy)
- def test_manage_afterAdd(self):
+ def test_afterAddHook(self):
# set up a component
path, component = 'foo', ComponentStub()
self.rootFolder.setObject(path, component)
@@ -119,11 +119,11 @@
self.rootFolder.setObject('cfg', cfg)
cfg = traverse(self.rootFolder, 'cfg')
# simulate IAddNotifiable
- cfg.manage_afterAdd(cfg, self.rootFolder)
+ cfg.afterAddHook(cfg, self.rootFolder)
# check that the dependency tracking works
self.assertEquals(component.dependents(), ('/cfg',))
- def test_manage_beforeDelete_dependents(self):
+ def test_beforeDeleteHook_dependents(self):
# set up a component
path, component = 'foo', ComponentStub()
self.rootFolder.setObject(path, component)
@@ -134,7 +134,7 @@
self.rootFolder.setObject('cfg', cfg)
cfg = traverse(self.rootFolder, 'cfg')
# simulate IDeleteNotifiable
- cfg.manage_beforeDelete(cfg, self.rootFolder)
+ cfg.beforeDeleteHook(cfg, self.rootFolder)
# check that the dependency tracking works
self.assertEquals(component.dependents(), ())
=== Zope3/src/zope/app/services/tests/test_serviceconfiguration.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/tests/test_serviceconfiguration.py:1.2 Wed Dec 25 09:13:20 2002
+++ Zope3/src/zope/app/services/tests/test_serviceconfiguration.py Wed Feb 26 11:11:37 2003
@@ -112,11 +112,11 @@
def test_getComponent(self):
self.assertEqual(self.__config.getComponent(), self.__c)
- def test_manage_afterAdd(self):
+ def test_afterAddHook(self):
self.assertEqual(self.__c._dependents,
('/++etc++Services/Packages/default/configure/1', ))
- def test_manage_beforeDelete_and_unregistered(self):
+ def test_beforeDeleteHook_and_unregistered(self):
self.__config.status = Registered
sm = getServiceManager(self.__default)