From 4a40c62f6616825342bb23d03b9c4b9eebfe809c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 1 Jun 2021 01:05:23 -0700 Subject: 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. --- tests/test_work_pipeline.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') 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": "dummy", "release_ident": "asdf123", "file_ident": "xyq9876"}, -- cgit v1.2.3