Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Peschke <luka.peschke@toucantoco.com>
  • Loading branch information
lukapeschke committed Jan 23, 2024
1 parent c72bfcd commit 20ada48
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/elasticsearch/test_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@ def pytest_generate_tests(metafunc):


def test_connector(mocker):
class ElasticsearchMock:
def search(self, index, body):
return {'hits': {'hits': [{'_source': {'yo': 'la'}}]}}

module = 'toucan_connectors.elasticsearch.elasticsearch_connector'
mock_es = mocker.patch(f'{module}.Elasticsearch')
mock_es.return_value = ElasticsearchMock()
mock_es.return_value.search.return_value = {'hits': {'hits': [{'_source': {'yo': 'la'}}]}}

con = ElasticsearchConnector(
name='test',
Expand Down

0 comments on commit 20ada48

Please sign in to comment.