aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/import_grobid_metadata.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-08 16:28:27 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-08 16:28:27 -0800
commit16f2e78298dbd2231f5f337ea17c89a6a131a052 (patch)
tree6e72581e625e73c97cbab72d0f9c35665c99e5d7 /python/tests/import_grobid_metadata.py
parenteb40a5f274f3608db34309cfd16739a7642ef5e7 (diff)
parentffb721f90c5d97ee80885209bf45feb85ca9625c (diff)
downloadfatcat-16f2e78298dbd2231f5f337ea17c89a6a131a052.tar.gz
fatcat-16f2e78298dbd2231f5f337ea17c89a6a131a052.zip
Merge branch 'bnewbold-crude-auth'
Fixed a conflict in: python/fatcat_export.py
Diffstat (limited to 'python/tests/import_grobid_metadata.py')
-rw-r--r--python/tests/import_grobid_metadata.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/python/tests/import_grobid_metadata.py b/python/tests/import_grobid_metadata.py
index 459b247b..97ebcaef 100644
--- a/python/tests/import_grobid_metadata.py
+++ b/python/tests/import_grobid_metadata.py
@@ -4,6 +4,7 @@ import json
import base64
import pytest
from fatcat_tools.importers import GrobidMetadataImporter
+from fixtures import api
"""
WARNING: these tests are currently very fragile because they have database
@@ -11,8 +12,8 @@ side-effects. Should probably be disabled or re-written.
"""
@pytest.fixture(scope="function")
-def grobid_metadata_importer():
- yield GrobidMetadataImporter("http://localhost:9411/v0")
+def grobid_metadata_importer(api):
+ yield GrobidMetadataImporter(api)
# TODO: use API to check that entities actually created...
#def test_grobid_metadata_importer_batch(grobid_metadata_importer):
@@ -54,3 +55,11 @@ def test_file_metadata_parse(grobid_metadata_importer):
def test_grobid_metadata_importer(grobid_metadata_importer):
with open('tests/files/example_grobid_metadata_lines.tsv', 'r') as f:
grobid_metadata_importer.process_source(f)
+
+ # fetch most recent editgroup
+ changes = grobid_metadata_importer.api.get_changelog(limit=1)
+ eg = changes[0].editgroup
+ assert eg.description
+ assert "grobid" in eg.description.lower()
+ assert eg.extra['git_rev']
+ assert "fatcat_tools.GrobidMetadataImporter" in eg.extra['agent']