def test_it_marks_annotation_as_deleted(self, es): index.delete(es, 'test_annotation_id') es.conn.index.assert_called_once_with(index='hypothesis', doc_type='annotation', body={'deleted': True}, id='test_annotation_id')
def delete_annotation(id_): delete(celery.request.es, id_) # If a reindex is running at the moment, delete annotation from the # new index as well. future_index = _current_reindex_new_name(celery.request, "reindex.new_index") if future_index is not None: delete(celery.request.es, id_, target_index=future_index)
def delete_annotation(id_): delete(celery.request.es, id_) # If a reindex is running at the moment, delete annotation from the # new index as well. future_index = _current_reindex_new_name(celery.request) if future_index is not None: delete(celery.request.es, id_, target_index=future_index)
def test_it_marks_annotation_as_deleted(self, es): index.delete(es, 'test_annotation_id') es.conn.index.assert_called_once_with( index='hypothesis', doc_type='annotation', body={'deleted': True}, id='test_annotation_id' )
def test_excludes_deleted_annotations(self, search, es_client, Annotation): deleted_ids = [Annotation(deleted=True).id] not_deleted_ids = [Annotation(deleted=False).id] # Deleted annotations need to be marked in the index using `h.search.index.delete`. for id_ in deleted_ids: index.delete(es_client, id_, refresh=True) result = search.run(webob.multidict.MultiDict({})) assert sorted(result.annotation_ids) == sorted(not_deleted_ids)
def test_excludes_deleted_annotations(self, search, es_client, Annotation): deleted_ids = [Annotation(deleted=True).id] not_deleted_ids = [Annotation(deleted=False).id] # Deleted annotations need to be marked in the index using `h.search.index.delete`. for id_ in deleted_ids: index.delete(es_client, id_, refresh=True) result = search.run(webob.multidict.MultiDict({})) assert sorted(result.annotation_ids) == sorted(not_deleted_ids)
def delete_annotation(id_): delete(celery.request.es, id_) if celery.request.feature('index_es6'): delete(celery.request.es6, id_) # If a reindex is running at the moment, delete annotation from the # new index as well. future_index = _current_reindex_new_name(celery.request, 'reindex.new_index') if future_index is not None: delete(celery.request.es, id_, target_index=future_index) future_es6_index = _current_reindex_new_name(celery.request, 'reindex.new_es6_index') if future_es6_index is not None: delete(celery.request.es6, id_, target_index=future_es6_index)
def test_it_allows_to_override_target_index(self, es): index.delete(es, 'test_annotation_id', target_index='custom-index') _, kwargs = es.conn.index.call_args assert kwargs['index'] == 'custom-index'
def test_it_allows_to_override_target_index(self, es): index.delete(es, 'test_annotation_id', target_index='custom-index') _, kwargs = es.conn.index.call_args assert kwargs['index'] == 'custom-index'