aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-01-14 17:15:01 -0800
committerBryan Newbold <bnewbold@archive.org>2020-01-14 17:15:01 -0800
commitaf2ffc0cea2d03a86f3ecf6c8dd0bd106a19b851 (patch)
tree0e3b4ce59e64cc405011b10ae43048d8070811c9 /python
parentd4d8e6f2026a5b4d1b08a008791f34140e678006 (diff)
downloadsandcrawler-af2ffc0cea2d03a86f3ecf6c8dd0bd106a19b851.tar.gz
sandcrawler-af2ffc0cea2d03a86f3ecf6c8dd0bd106a19b851.zip
tests: don't use localhost as a responses mock host
Diffstat (limited to 'python')
-rw-r--r--python/tests/test_grobid.py8
-rw-r--r--python/tests/test_ingest.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/python/tests/test_grobid.py b/python/tests/test_grobid.py
index 24ea40e..36d90ef 100644
--- a/python/tests/test_grobid.py
+++ b/python/tests/test_grobid.py
@@ -15,7 +15,7 @@ with open('tests/files/23b29ea36382680716be08fc71aa81bd226e8a85.xml', 'rb') as f
@pytest.fixture
def grobid_client():
client = GrobidClient(
- host_url="http://localhost:8070",
+ host_url="http://dummy-grobid",
)
return client
@@ -24,7 +24,7 @@ def test_grobid_503(grobid_client):
status = b'{"status": "done broke due to 503"}'
responses.add(responses.POST,
- 'http://localhost:8070/api/processFulltextDocument', status=503,
+ 'http://dummy-grobid/api/processFulltextDocument', status=503,
body=status)
resp = grobid_client.process_fulltext(FAKE_PDF_BYTES)
@@ -39,7 +39,7 @@ def test_grobid_503(grobid_client):
def test_grobid_success(grobid_client):
responses.add(responses.POST,
- 'http://localhost:8070/api/processFulltextDocument', status=200,
+ 'http://dummy-grobid/api/processFulltextDocument', status=200,
body=REAL_TEI_XML, content_type='text/xml')
resp = grobid_client.process_fulltext(FAKE_PDF_BYTES)
@@ -60,7 +60,7 @@ def test_grobid_worker_cdx(grobid_client, wayback_client):
worker = GrobidWorker(grobid_client, wayback_client, sink=sink)
responses.add(responses.POST,
- 'http://localhost:8070/api/processFulltextDocument', status=200,
+ 'http://dummy-grobid/api/processFulltextDocument', status=200,
body=REAL_TEI_XML, content_type='text/xml')
with open('tests/files/example.cdx', 'r') as cdx_file:
diff --git a/python/tests/test_ingest.py b/python/tests/test_ingest.py
index f5599e9..5c2a621 100644
--- a/python/tests/test_ingest.py
+++ b/python/tests/test_ingest.py
@@ -12,7 +12,7 @@ from test_grobid import REAL_TEI_XML
@pytest.fixture
def ingest_worker(wayback_client, spn_client):
grobid_client = GrobidClient(
- host_url="http://localhost:8070",
+ host_url="http://dummy-grobid",
)
worker = IngestFileWorker(
wayback_client=wayback_client,
@@ -66,7 +66,7 @@ def test_ingest_success(ingest_worker_pdf):
headers={"X-Archive-Src": "liveweb-whatever.warc.gz"},
body=pdf_bytes)
responses.add(responses.POST,
- 'http://localhost:8070/api/processFulltextDocument', status=200,
+ 'http://dummy-grobid/api/processFulltextDocument', status=200,
body=REAL_TEI_XML, content_type='text/xml')
resp = ingest_worker_pdf.process(request)