From 6a56b922ced9013c6d09027d771dc8c4fc80421e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 14 Jan 2020 17:15:22 -0800 Subject: add postgrest checks to test mocks --- python/tests/test_ingest.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/tests/test_ingest.py b/python/tests/test_ingest.py index 5c2a621..8f96a26 100644 --- a/python/tests/test_ingest.py +++ b/python/tests/test_ingest.py @@ -24,12 +24,16 @@ def ingest_worker(wayback_client, spn_client): @pytest.fixture def ingest_worker_pdf(wayback_client_pdf, spn_client): grobid_client = GrobidClient( - host_url="http://localhost:8070", + host_url="http://dummy-grobid", + ) + pgrest_client = SandcrawlerPostgrestClient( + api_url="http://dummy-postgrest", ) worker = IngestFileWorker( wayback_client=wayback_client_pdf, spn_client=spn_client, grobid_client=grobid_client, + pgrest_client=pgrest_client, ) return worker @@ -65,6 +69,10 @@ def test_ingest_success(ingest_worker_pdf): status=200, headers={"X-Archive-Src": "liveweb-whatever.warc.gz"}, body=pdf_bytes) + responses.add(responses.GET, + 'http://dummy-postgrest/grobid?sha1hex=eq.{}'.format("90ffd2359008d82298821d16b21778c5c39aec36"), + status=200, + body=json.dumps([])) responses.add(responses.POST, 'http://dummy-grobid/api/processFulltextDocument', status=200, body=REAL_TEI_XML, content_type='text/xml') -- cgit v1.2.3