Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)

src/p/r/Products.BooleanIndex-1.0.2/Products/BooleanIndex/tests.py   Products.BooleanIndex(Download)
        index._index_object(obj.id, obj, attr='truth')
 
        res,idx = index._apply_index({'truth':True}, res=None)
        self.failUnlessEqual(idx, ('truth',))
        self.failUnlessEqual(list(res), [1])
        index._index_object(obj.id, obj, attr='truth')
 
        res,idx = index._apply_index({'truth':False}, res=None)
        self.failUnlessEqual(idx, ('truth',))
        self.failUnlessEqual(list(res), [2])
        index._index_object(obj.id, obj, attr='truth')
 
        res,idx = index._apply_index({'truth':True}, res=IISet([]))
        self.failUnlessEqual(idx, ('truth',))
        self.failUnlessEqual(list(res), [])
 
        res,idx = index._apply_index({'truth':True}, res=IISet([2]))
        self.failUnlessEqual(list(res), [])
 
        res,idx = index._apply_index({'truth':True}, res=IISet([1]))
        self.failUnlessEqual(idx, ('truth',))
        self.failUnlessEqual(list(res), [1])