[Zope3-checkins] CVS: Zope3/src/zope/app/index/field/tests - test_index.py:1.4

Jim Fulton jim at zope.com
Sun Sep 21 13:32:50 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/index/field/tests
In directory cvs.zope.org:/tmp/cvs-serv14176/src/zope/app/index/field/tests

Modified Files:
	test_index.py 
Log Message:
Changed to use __setitem__ rather than setObject

Object events no longer have locations.


=== Zope3/src/zope/app/index/field/tests/test_index.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/index/field/tests/test_index.py:1.3	Mon Jun 23 12:44:38 2003
+++ Zope3/src/zope/app/index/field/tests/test_index.py	Sun Sep 21 13:32:19 2003
@@ -64,9 +64,9 @@
         provideAdapter(None, ISomeInterface, SomeAdapter)
         self.buildFolders()
         self.index = FieldIndex('zope3')
-        self.rootFolder.setObject('myIndex', self.index)
-        self.object = FakeSearchableObject()
-        self.rootFolder.setObject('bruce', self.object)
+        self.rootFolder['myIndex'] = self.index
+        self.rootFolder['bruce'] = FakeSearchableObject()
+        self.object = self.rootFolder['bruce']
 
     def assertPresent(self, value, docid):
         result = self.index.search(value)
@@ -108,12 +108,11 @@
         hub.subscribe(index, IRegistrationHubEvent)
         hub.subscribe(index, IObjectModifiedHubEvent)
         location = "/bruce"
-        self.rootFolder.setObject(location, self.object)
         hubid = hub.register(location)
         self.assertPresent(Bruce, hubid)
 
         self.object.zope3 = 38
-        event = ObjectModifiedEvent(self.object, location)
+        event = ObjectModifiedEvent(self.object)
         hub.notify(event)
         self.assertPresent(38, hubid)
         self.assertAbsent(Sheila)
@@ -132,8 +131,8 @@
         self.assertEqual(index.isSubscribed(), False)
         self.assertAbsent(Bruce)
         self.assertAbsent(Sheila)
-        location = '/bruce'
         hub = getService(self.rootFolder, HubIds)
+        location = '/bruce'
         hubid = hub.register(location)
         index.subscribe(hub)
         self.assertEqual(index.isSubscribed(), True)
@@ -144,7 +143,7 @@
         self.assertPresent(Bruce, hubid)
 
         self.object.zope3 = [Sheila]
-        event = ObjectModifiedEvent(self.object, location)
+        event = ObjectModifiedEvent(self.object)
         hub.notify(event)
         self.assertPresent(Bruce, hubid)
         self.assertAbsent(Sheila)




More information about the Zope3-Checkins mailing list