aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-06-01 01:05:23 -0700
committerBryan Newbold <bnewbold@archive.org>2021-06-02 00:38:51 -0700
commit4a40c62f6616825342bb23d03b9c4b9eebfe809c (patch)
treef999a05e76a4e2c3965dca2a12a07f654810f869 /tests
parent01a1978d5b9667df4ae71a7934512e6c4e3bf9a8 (diff)
downloadfatcat-scholar-4a40c62f6616825342bb23d03b9c4b9eebfe809c.tar.gz
fatcat-scholar-4a40c62f6616825342bb23d03b9c4b9eebfe809c.zip
add 'crossref' hydration to work pipeline
The immediate motivation is to include recent crossref refs in citation graph transforms. May also be valuable for researchers to have authoritative/publisher metadata in the bundle dumps.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_work_pipeline.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_work_pipeline.py b/tests/test_work_pipeline.py
index e0e4a82..bf423b7 100644
--- a/tests/test_work_pipeline.py
+++ b/tests/test_work_pipeline.py
@@ -69,6 +69,22 @@ def test_run_transform(mocker: Any) -> None:
],
)
+ responses.add(
+ responses.GET,
+ "http://disabled-during-tests-bogus.xyz:3333/crossref?doi=eq.10.7717%2Fpeerj.4375",
+ status=200,
+ json=[
+ {
+ "doi": "10.7717/peerj.4375",
+ "indexed": "2020-07-07T02:15:52.98309+00:00",
+ "record": {
+ "title": "something",
+ "TODO_better_object": 3,
+ },
+ }
+ ],
+ )
+
es_raw = mocker.patch("fatcat_scholar.work_pipeline.WorkPipeline.fetch_file_grobid")
es_raw.side_effect = [
{"tei_xml": "<xml>dummy", "release_ident": "asdf123", "file_ident": "xyq9876"},