[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - eventsetup.py:1.6 placefulsetup.py:1.14 test_auth.py:1.10 test_cachingservice.py:1.6 test_eventservice.py:1.17 test_hookedhubevent.py:1.5

Albertas Agejevas alga@codeworks.lt
Wed, 19 Mar 2003 14:58:04 -0500


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

Modified Files:
	eventsetup.py placefulsetup.py test_auth.py 
	test_cachingservice.py test_eventservice.py 
	test_hookedhubevent.py 
Log Message:
Renamed getPgysicalPathString() to getPath().

Got rid of getPhysicalPath() (which used to return a tuple) by replacing it
by getPath().


=== Zope3/src/zope/app/services/tests/eventsetup.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/services/tests/eventsetup.py:1.5	Mon Jan 27 13:31:51 2003
+++ Zope3/src/zope/app/services/tests/eventsetup.py	Wed Mar 19 14:57:32 2003
@@ -19,7 +19,7 @@
 from zope.app.services.tests.placefulsetup import PlacefulSetup
 from zope.app.services.service import ServiceManager, ServiceConfiguration
 from zope.app.services.event import EventService
-from zope.app.traversing import getPhysicalPathString, traverse
+from zope.app.traversing import traverse
 from zope.app.interfaces.services.configuration import Active
 from zope.app.interfaces.services.event import ISubscriptionService
 


=== Zope3/src/zope/app/services/tests/placefulsetup.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/services/tests/placefulsetup.py:1.13	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/placefulsetup.py	Wed Mar 19 14:57:32 2003
@@ -35,7 +35,7 @@
 from zope.app.traversing.adapters import DefaultTraversable
 from zope.app.traversing.adapters import WrapperPhysicallyLocatable
 from zope.app.traversing.adapters import Traverser, RootPhysicallyLocatable
-from zope.app.traversing import traverse, getPhysicalPathString
+from zope.app.traversing import traverse, getPath
 from zope.app.services.service import ServiceManager, ServiceConfiguration
 from zope.app.interfaces.services.configuration import Active
 from zope.app.interfaces.services.configuration import IAttributeUseConfigurable
@@ -171,7 +171,7 @@
         from zope.app.services.event import EventService
         default.setObject(service_name, EventService())
 
-        path = "%s/%s" % (getPhysicalPathString(default), service_name)
+        path = "%s/%s" % (getPath(default), service_name)
         configuration = ServiceConfiguration(EventPublication, path, self.rootFolder)
         default['configure'].setObject(
                 "%sEventsDir" % service_name, configuration)
@@ -210,7 +210,7 @@
         default.setObject("myEventService", EventService())
         default.setObject("myObjectHub", self.getObjectHub())
 
-        path = "%s/default/myEventService" % getPhysicalPathString(sm)
+        path = "%s/default/myEventService" % getPath(sm)
         configuration = ServiceConfiguration(EventPublication, path, self.rootFolder)
         default['configure'].setObject("myEventServiceDir", configuration)
         traverse(default, 'configure/1').status = Active
@@ -221,7 +221,7 @@
                 "mySubscriptionServiceDir", configuration)
         traverse(default, 'configure/2').status = Active
 
-        path = "%s/default/myObjectHub" % getPhysicalPathString(sm)
+        path = "%s/default/myObjectHub" % getPath(sm)
         configuration = ServiceConfiguration(HubIds, path, self.rootFolder)
         default['configure'].setObject("myHubIdsServiceDir", configuration)
         traverse(default, 'configure/3').status = Active


=== Zope3/src/zope/app/services/tests/test_auth.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/services/tests/test_auth.py:1.9	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_auth.py	Wed Mar 19 14:57:32 2003
@@ -26,7 +26,7 @@
 from zope.publisher.interfaces.http import IHTTPCredentials
 from zope.app.services.service import ServiceConfiguration
 from zope.app.services.tests.eventsetup import EventSetup
-from zope.app.traversing import getPhysicalPathString, traverse
+from zope.app.traversing import getPath, traverse
 from zope.app.interfaces.services.configuration import Active, Registered
 
 from zope.app.container.tests.test_icontainer import BaseTestIContainer
@@ -66,7 +66,7 @@
         key = default.setObject("AuthenticationService", AuthenticationService())
         auth = traverse(default, key)
 
-        path = getPhysicalPathString(auth)
+        path = getPath(auth)
         configuration = ServiceConfiguration(Authentication, path)
         configure = traverse(default, 'configure')
         key = configure.setObject(None, configuration)


=== Zope3/src/zope/app/services/tests/test_cachingservice.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/services/tests/test_cachingservice.py:1.5	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_cachingservice.py	Wed Mar 19 14:57:32 2003
@@ -24,7 +24,7 @@
 from zope.app.interfaces.services.configuration import Active, Registered
 from zope.app.services.tests.eventsetup import EventSetup
 from zope.app.services.service import ServiceConfiguration
-from zope.app.traversing import getPhysicalPathString, traverse
+from zope.app.traversing import getPath, traverse
 
 
 def sort(list):
@@ -61,7 +61,7 @@
         key = default.setObject("myCachingService", CachingService())
         service = traverse(default, key)
 
-        path = getPhysicalPathString(service)
+        path = getPath(service)
         configuration = ServiceConfiguration("Caching", path)
         configure = traverse(default, 'configure')
         key = configure.setObject(None, configuration)
@@ -80,7 +80,7 @@
         cache = traverse(default, key)
         configure = traverse(default, 'configure')
         key = configure.setObject(None, CacheConfiguration(name,
-                                            getPhysicalPathString(cache)))
+                                                           getPath(cache)))
         traverse(configure, key).status = status
         return cache
 


=== Zope3/src/zope/app/services/tests/test_eventservice.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/services/tests/test_eventservice.py:1.16	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_eventservice.py	Wed Mar 19 14:57:32 2003
@@ -23,7 +23,7 @@
 from zope.component import getServiceManager
 from zope.app.services.servicenames import EventPublication, EventSubscription
 from zope.app.services.event import EventService
-from zope.app.traversing import getPhysicalPathString, traverse
+from zope.app.traversing import getPath, traverse
 from zope.exceptions import NotFoundError
 from zope.app.services.event import subscribe, unsubscribe, unsubscribeAll
 from zope.app.services.event import iterSubscriptions, getSubscriptionService
@@ -168,22 +168,16 @@
                             event_type=IObjectAddedEvent)
         folder1_1 = subscribe(self.folder1_1Subscriber,
                               event_type=IObjectAddedEvent)
-        self.assertEqual(
-            root,
-            getPhysicalPathString(self.rootFolderSubscriber))
-        self.assertEqual(
-            folder1,
-            getPhysicalPathString(self.folder1Subscriber))
-        self.assertEqual(
-            folder1_1,
-            getPhysicalPathString(self.folder1_1Subscriber))
+        self.assertEqual(root, getPath(self.rootFolderSubscriber))
+        self.assertEqual(folder1, getPath(self.folder1Subscriber))
+        self.assertEqual(folder1_1, getPath(self.folder1_1Subscriber))
         publish(self.folder1, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
         self.assertEqual(self.folder1Subscriber.notified, 1)
         self.assertEqual(self.folder1_1Subscriber.notified, 1)
-        rootPath = getPhysicalPathString(self.rootFolderSubscriber)
-        folder1Path = getPhysicalPathString(self.folder1Subscriber)
-        folder1_1Path = getPhysicalPathString(self.folder1_1Subscriber)
+        rootPath = getPath(self.rootFolderSubscriber)
+        folder1Path = getPath(self.folder1Subscriber)
+        folder1_1Path = getPath(self.folder1_1Subscriber)
         unsubscribeAll(rootPath, context=self.rootFolder)
             # curve ball:
         unsubscribeAll(self.folder1Subscriber, context=self.folder1_1)
@@ -223,7 +217,7 @@
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
         self.assertEqual(self.folder1Subscriber.notified, 1)
         self.assertEqual(self.folder1_1Subscriber.notified, 1)
-        unsubscribe(getPhysicalPathString(self.rootFolderSubscriber),
+        unsubscribe(getPath(self.rootFolderSubscriber),
                     event_type=IObjectAddedEvent,
                     context=self.rootFolder)
         subscribe(self.rootFolderSubscriber,
@@ -249,15 +243,9 @@
                             event_type=IObjectAddedEvent)
         folder1_1 = subscribe(self.folder1_1Subscriber,
                               event_type=IObjectAddedEvent)
-        self.assertEqual(
-            root,
-            getPhysicalPathString(self.rootFolderSubscriber))
-        self.assertEqual(
-            folder1,
-            getPhysicalPathString(self.folder1Subscriber))
-        self.assertEqual(
-            folder1_1,
-            getPhysicalPathString(self.folder1_1Subscriber))
+        self.assertEqual(root, getPath(self.rootFolderSubscriber))
+        self.assertEqual(folder1, getPath(self.folder1Subscriber))
+        self.assertEqual(folder1_1, getPath(self.folder1_1Subscriber))
         # Remove folder1Subscriber, so that the event service will not
         # be able to notify it.
         folder1Subscriber = self.folder1['folder1Subscriber']
@@ -281,9 +269,9 @@
         # test complex interaction, with hubids available but explicitly
         # using paths
         self._createHubIdSubscribers()
-        rootPath = getPhysicalPathString(self.rootFolderSubscriber)
-        folder1Path = getPhysicalPathString(self.folder1Subscriber)
-        folder1_1Path = getPhysicalPathString(self.folder1_1Subscriber)
+        rootPath = getPath(self.rootFolderSubscriber)
+        folder1Path = getPath(self.folder1Subscriber)
+        folder1_1Path = getPath(self.folder1_1Subscriber)
         self.assertEqual(
             rootPath,
             subscribe(
@@ -353,7 +341,7 @@
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
         self.assertEqual(self.folder1Subscriber.notified, 1)
         self.assertEqual(self.folder1_1Subscriber.notified, 1)
-        unsubscribe(getPhysicalPathString(self.rootFolderSubscriber),
+        unsubscribe(getPath(self.rootFolderSubscriber),
                     event_type=IObjectAddedEvent,
                     context=self.rootFolder)
         subscribe(self.rootFolderSubscriber, event_type=IObjectAddedEvent,
@@ -849,7 +837,7 @@
 
         default.setObject("myEventService", service)
 
-        path = "%s/default/myEventService" % getPhysicalPathString(sm)
+        path = "%s/default/myEventService" % getPath(sm)
         configuration = ServiceConfiguration(EventPublication, path)
         default['configure'].setObject("myEventServiceDir", configuration)
         traverse(default, 'configure/1').status = Active


=== Zope3/src/zope/app/services/tests/test_hookedhubevent.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/tests/test_hookedhubevent.py:1.4	Wed Mar 19 13:05:04 2003
+++ Zope3/src/zope/app/services/tests/test_hookedhubevent.py	Wed Mar 19 14:57:32 2003
@@ -26,7 +26,7 @@
 from zope.app.services.hub import \
      ObjectRegisteredHubEvent, ObjectUnregisteredHubEvent, \
      ObjectModifiedHubEvent, ObjectMovedHubEvent, ObjectRemovedHubEvent
-from zope.app.traversing import getPhysicalPathString as getPath
+from zope.app.traversing import getPath
 
 from zope.component import getService