[Zope3-checkins] CVS: Zope3/src/zope/app/catalog/tests - test_catalog.py:1.8

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


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

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


=== Zope3/src/zope/app/catalog/tests/test_catalog.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/catalog/tests/test_catalog.py:1.7	Sun Aug 17 02:06:11 2003
+++ Zope3/src/zope/app/catalog/tests/test_catalog.py	Sun Sep 21 13:30:42 2003
@@ -84,19 +84,13 @@
 
 class Test(PlacelessSetup, unittest.TestCase):
 
-    def setUp(self):
-	pass
-
-    def teardown(self):
-	pass
-
     def test_catalog_add_del_indexes(self):
 	catalog = Catalog()
 	index = StubIndex('author', None)
-	catalog.setObject('author', index)
+	catalog['author'] = index
 	self.assertEqual(catalog.keys(), ['author'])
 	index = StubIndex('title', None)
-	catalog.setObject('title', index)
+	catalog['title'] = index
 	indexes = catalog.keys()
 	indexes.sort()
 	self.assertEqual(indexes, ['author', 'title'])
@@ -105,8 +99,8 @@
 
     def test_catalog_notification_passing(self):
 	catalog = Catalog()
-	catalog.setObject('author', StubIndex('author', None))
-	catalog.setObject('title', StubIndex('title', None))
+	catalog['author'] = StubIndex('author', None)
+	catalog['title'] = StubIndex('title', None)
         catalog.notify(regEvt(None, None, 'reg1', 1))
         catalog.notify(regEvt(None, None, 'reg2', 2))
         catalog.notify(regEvt(None, None, 'reg3', 3))
@@ -149,8 +143,8 @@
         "test a full refresh"
         self._frob_objecthub()
         catalog = Catalog()
-	catalog.setObject('author', StubIndex('author', None))
-	catalog.setObject('title', StubIndex('author', None))
+	catalog['author'] = StubIndex('author', None)
+	catalog['title'] = StubIndex('author', None)
         catalog.updateIndexes()
         for index in catalog.values():
             checkNotifies = index._notifies
@@ -165,8 +159,8 @@
         "test the simple searchresults interface"
         self._frob_objecthub(ints=0)
         catalog = Catalog()
-	catalog.setObject('simiantype', StubIndex('simiantype', None))
-	catalog.setObject('name', StubIndex('name', None))
+	catalog['simiantype'] = StubIndex('simiantype', None)
+	catalog['name'] = StubIndex('name', None)
         catalog.updateIndexes()
         res = catalog.searchResults(simiantype='monkey')
         names = [ x.name for x in res ]




More information about the Zope3-Checkins mailing list