From a1f14f5b5ce087cb4681d46817da2be0777e4220 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 2 Jul 2020 12:12:11 -0700 Subject: update web_search tests to mock ES client Instead of using 'responses' mock of 'requests' library. Tried using 'elasticmock' helper but it didn't work. --- python/tests/fixtures.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python/tests/fixtures.py') diff --git a/python/tests/fixtures.py b/python/tests/fixtures.py index 44c7be63..3263f243 100644 --- a/python/tests/fixtures.py +++ b/python/tests/fixtures.py @@ -1,9 +1,10 @@ import pytest from dotenv import load_dotenv +import elasticsearch + import fatcat_web import fatcat_openapi_client - from fatcat_openapi_client import * from fatcat_tools import authenticated_api @@ -13,6 +14,7 @@ def full_app(): fatcat_web.app.testing = True fatcat_web.app.debug = False fatcat_web.app.config['WTF_CSRF_ENABLED'] = False + fatcat_web.app.es_client = elasticsearch.Elasticsearch("mockbackend") return fatcat_web.app @pytest.fixture -- cgit v1.2.3