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

Jim Fulton jim at zope.com
Mon Sep 15 14:13:05 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	test_index.py 
Log Message:
Got lots of tests to pass.

Added a setitem helper function to be used to help satisfy container
contracts.



=== Zope3/src/zope/app/index/field/tests/test_index.py 1.3.22.1 => 1.3.22.2 ===
--- Zope3/src/zope/app/index/field/tests/test_index.py:1.3.22.1	Fri Sep 12 15:15:28 2003
+++ Zope3/src/zope/app/index/field/tests/test_index.py	Mon Sep 15 14:12:34 2003
@@ -65,8 +65,8 @@
         self.buildFolders()
         self.index = FieldIndex('zope3')
         self.rootFolder['myIndex'] = self.index
-        self.object = FakeSearchableObject()
-        self.rootFolder['bruce'] = self.object
+        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[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