def test_unindex_find_keys_pointing_to_rid(self): mock = Mock() mock.foo = 'a key' index = UnIndex('foo') index.index_object(-12, mock) self.assertItemsEqual(['a key'], find_keys_pointing_to_rid(index, -12))
def index_object(self, documentId, obj, threshold=None): """ wrapper to handle indexing of multiple attributes """ res = 0 for lang in self.languages: self._v_lang = lang res += UnIndex.index_object(self, documentId, obj, threshold) self._v_lang = None return res > 0
def index_object(self, documentId, obj, threshold=None): """ wrapper to handle indexing of multiple attributes """ res = 0 for lang in self.languages: self._v_lang = lang res += UnIndex.index_object(self, documentId, obj, threshold) self._v_lang = None return res > 0