[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests -
test_servicemanager.py:1.16.6.1
Jim Fulton
cvs-admin at zope.org
Tue Nov 11 12:28:30 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv28715/src/zope/app/services/tests
Modified Files:
Tag: adaptergeddon-branch
test_servicemanager.py
Log Message:
Changed local site managers (aka service managers) to have next and
subSites attributes. Now local service managers are linked up to make
it easier to navigate related sites.
=== Zope3/src/zope/app/services/tests/test_servicemanager.py 1.16 => 1.16.6.1 ===
--- Zope3/src/zope/app/services/tests/test_servicemanager.py:1.16 Sun Sep 21 13:33:25 2003
+++ Zope3/src/zope/app/services/tests/test_servicemanager.py Tue Nov 11 12:27:53 2003
@@ -18,6 +18,9 @@
"""
from unittest import TestCase, TestLoader, TextTestRunner
+
+from zope.app import zapi
+from zope.app.tests import setup
from zope.interface import Interface, implements
from zope.app.services.service import ServiceManager
from zope.app.services.service import ServiceRegistration
@@ -210,6 +213,19 @@
self.assertEqual(sm2.resolve("XXX.ZZZ.ZZZ"), 42)
self.assertEqual(sm2.resolve("XXX.ZZZ."), 42)
self.assertEqual(sm2.resolve("XXX.ZZZ.x"), "root m2")
+
+ def test_site_manager_connections(self):
+ root = self.rootFolder
+ mr = root.getSiteManager()
+ m1 = setup.createServiceManager(zapi.traverse(root, 'folder1'))
+ m2 = setup.createServiceManager(zapi.traverse(root, 'folder2'))
+ m11 = setup.createServiceManager(
+ zapi.traverse(root, 'folder1/folder1_1'))
+ self.assertEqual(m1.next, mr)
+ self.assertEqual(m2.next, mr)
+ self.assertEqual(m11.next, m1)
+ self.assertEqual(mr.subSites, (m1, m2))
+ self.assertEqual(m1.subSites, (m11, ))
def test_suite():
More information about the Zope3-Checkins
mailing list