[Zope3-checkins] CVS: Zope3/src/zope/app/fssync/tests - test_committer.py:1.8
Guido van Rossum
guido@python.org
Thu, 29 May 2003 14:04:26 -0400
Update of /cvs-repository/Zope3/src/zope/app/fssync/tests
In directory cvs.zope.org:/tmp/cvs-serv28068/tests
Modified Files:
test_committer.py
Log Message:
In order to be able to commit thigs under ++etc++site, we need to use
traverseName(container, name) rather than container[name].
=== Zope3/src/zope/app/fssync/tests/test_committer.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/fssync/tests/test_committer.py:1.7 Thu May 29 12:19:47 2003
+++ Zope3/src/zope/app/fssync/tests/test_committer.py Thu May 29 14:04:26 2003
@@ -23,6 +23,7 @@
from zope.component.service import serviceManager
from zope.component.adapter import provideAdapter
from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.exceptions import NotFoundError
from zope.testing.cleanup import CleanUp
from zope.xmlpickle import loads, dumps
@@ -33,6 +34,7 @@
from zope.app.interfaces.container import IContainer
from zope.app.interfaces.file import IFileFactory, IDirectoryFactory
from zope.app.interfaces.fssync import IGlobalFSSyncService
+from zope.app.interfaces.traversing import ITraversable
from zope.app.fssync.committer import Committer, SynchronizationError
from zope.app.fssync.fsregistry import provideSynchronizer, fsRegistry
@@ -45,7 +47,7 @@
class PretendContainer(object):
- __implements__ = IContainer
+ __implements__ = IContainer, ITraversable
def __init__(self):
self.holding = {}
@@ -71,6 +73,12 @@
def items(self):
return self.holding.items()
+
+ def traverse(self, name, parameters, pname, furtherPath):
+ try:
+ return self[name]
+ except KeyError:
+ raise NotFoundError
PCname = PretendContainer.__module__ + "." + PretendContainer.__name__