[Zope3-checkins] CVS: Zope3/src/zope/app/fssync/tests - test_committer.py:1.18

Jim Fulton cvs-admin at zope.org
Fri Nov 21 12:12:36 EST 2003


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

Modified Files:
	test_committer.py 
Log Message:
Changed to use the new ztapi module, which provides handy functions
for setting up adapters and views for tests.  This is needed because
there are no-longer global adapter and view services sitting around as
module globals.


=== Zope3/src/zope/app/fssync/tests/test_committer.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/fssync/tests/test_committer.py:1.17	Sun Sep 21 13:32:11 2003
+++ Zope3/src/zope/app/fssync/tests/test_committer.py	Fri Nov 21 12:12:05 2003
@@ -21,7 +21,7 @@
 import unittest
 
 from zope.component.service import serviceManager
-from zope.component.adapter import provideAdapter
+from zope.app.tests import ztapi
 from zope.exceptions import NotFoundError
 from zope.interface import implements
 
@@ -214,7 +214,7 @@
         self.assertEqual(container.items(), [("foo", ["hello", "world"])])
 
     def test_create_object_ifilefactory(self):
-        provideAdapter(IContainer, IFileFactory, file_factory_maker)
+        ztapi.provideAdapter(IContainer, IFileFactory, file_factory_maker)
         container = PretendContainer()
         entry = {"flag": "added"}
         data = ["hello", "world"]
@@ -224,7 +224,7 @@
         self.assertEqual(container.holding, {"foo": ["hello", "world"]})
 
     def test_create_object_idirectoryfactory(self):
-        provideAdapter(IContainer, IDirectoryFactory, directory_factory_maker)
+        ztapi.provideAdapter(IContainer, IDirectoryFactory, directory_factory_maker)
         container = PretendContainer()
         entry = {"flag": "added"}
         tfn = os.path.join(self.tempdir(), "foo")
@@ -242,8 +242,9 @@
         # Set up environment
         provideSynchronizer(PretendContainer, DirectoryAdapter)
         provideSynchronizer(dict, DictAdapter)
-        provideAdapter(IContainer, IFileFactory, file_factory_maker)
-        provideAdapter(IContainer, IDirectoryFactory, directory_factory_maker)
+        ztapi.provideAdapter(IContainer, IFileFactory, file_factory_maker)
+        ztapi.provideAdapter(IContainer, IDirectoryFactory,
+                             directory_factory_maker)
 
         # Set up fixed part of object tree
         self.parent = PretendContainer()




More information about the Zope3-Checkins mailing list