diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-01-14 17:15:22 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-01-14 17:15:22 -0800 |
commit | 6a56b922ced9013c6d09027d771dc8c4fc80421e (patch) | |
tree | 0c72cf529bbbf51969a6dee643f9d6acff14b782 /python/tests | |
parent | af2ffc0cea2d03a86f3ecf6c8dd0bd106a19b851 (diff) | |
download | sandcrawler-6a56b922ced9013c6d09027d771dc8c4fc80421e.tar.gz sandcrawler-6a56b922ced9013c6d09027d771dc8c4fc80421e.zip |
add postgrest checks to test mocks
Diffstat (limited to 'python/tests')
-rw-r--r-- | python/tests/test_ingest.py | 10 |
1 files changed, 9 insertions, 1 deletions
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') |