def afterSetUp(self): self.app.real_cat = ZCatalog('real_cat') self.app.real_cat.addIndex('id', 'FieldIndex') self.app.real_cat.addIndex('title', 'FieldIndex') self.app.real_cat.addIndex('meta_type', 'FieldIndex') self.app.queue_cat = QueueCatalog(3) # 3 buckets self.app.queue_cat.id = 'queue_cat' self.app.queue_cat.manage_edit(location='/real_cat', immediate_indexes=['id', 'title'])
def setUp(self): app = Zope.app() self.app = app app.real_cat = ZCatalog('real_cat') app.real_cat.addIndex('id', 'FieldIndex') app.real_cat.addIndex('meta_type', 'FieldIndex') app.queue_cat = QueueCatalog(3) # 3 buckets app.queue_cat.id = 'queue_cat' app.queue_cat.manage_edit(location='/real_cat', immediate_indexes=['id'])
def testImmediateDeletion(self): app = self.app app.test_cat = QueueCatalog(1000) # 1000 buckets to prevent collisions app.test_cat.id = 'test_cat' app.test_cat.manage_edit(location='/real_cat', immediate_indexes=['id'], immediate_removal=1) for n in range(20): f = Folder() f.id = 'f%d' % n setattr(app, f.id, f) f = getattr(app, f.id) app.test_cat.catalog_object(f) self.assertEqual(app.test_cat.manage_size(), 20) # "Delete" one. This should be processed immediately (including # the add-event) app.test_cat.uncatalog_object(getattr(app, 'f1').getPhysicalPath()) self.assertEqual(app.test_cat.manage_size(), 19) del app.test_cat