aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_grobid2json.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-10-27 15:33:29 -0700
committerBryan Newbold <bnewbold@archive.org>2021-10-27 18:25:58 -0700
commit33211915773a0c77d064c55c1b02ceed6f455feb (patch)
tree1828505db917686e7223d41e97c6446223f2da32 /tests/test_grobid2json.py
parent6c103e4dc48e7e0c0f6cdedc18b0afe33babf1ac (diff)
downloadfatcat-scholar-33211915773a0c77d064c55c1b02ceed6f455feb.tar.gz
fatcat-scholar-33211915773a0c77d064c55c1b02ceed6f455feb.zip
replace grobid2json with grobid_tei_xml
This first iteration uses the .to_legacy_dict() helpers for backwards compatibility
Diffstat (limited to 'tests/test_grobid2json.py')
-rw-r--r--tests/test_grobid2json.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test_grobid2json.py b/tests/test_grobid2json.py
index 345fd91..adf36a1 100644
--- a/tests/test_grobid2json.py
+++ b/tests/test_grobid2json.py
@@ -1,12 +1,17 @@
-from fatcat_scholar.grobid2json import teixml2json
+from grobid_tei_xml import parse_document_xml
-def test_grobid_teixml2json() -> None:
+def test_grobid_parse() -> None:
+ """
+ This function formerly tested the grobid2json file in this project. Now it
+ tests backwards-compatibility of the grobid_tei_xml library.
+ """
with open("tests/files/example_grobid.tei.xml", "r") as f:
blob = f.read()
- obj = teixml2json(blob, True)
+ doc = parse_document_xml(blob)
+ obj = doc.to_legacy_dict()
assert (
obj["title"]