def test_index_all(self, monkeypatch): bulk_index = pretend.call_recorder(lambda es, docs: None) monkeypatch.setattr(indexes, "bulk_index", bulk_index) index = pretend.stub( _index="warehouse", es=pretend.stub(), ) bmap = BaseMapping(index=index) bmap.get_indexable = pretend.call_recorder(lambda: []) bmap.index_all() assert bulk_index.calls == [pretend.call(index.es, [])] assert bmap.get_indexable.calls == [pretend.call()]
def test_search(self): bmap = BaseMapping(index=pretend.stub()) with pytest.raises(NotImplementedError): bmap.search(None)
def test_extract_document(self): bmap = BaseMapping(index=pretend.stub()) with pytest.raises(NotImplementedError): bmap.extract_document(None)
def test_get_indexable(self): bmap = BaseMapping(index=pretend.stub()) with pytest.raises(NotImplementedError): bmap.get_indexable()