aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/crossref.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests/crossref.py')
-rw-r--r--python/tests/crossref.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/tests/crossref.py b/python/tests/crossref.py
new file mode 100644
index 00000000..e72f7d02
--- /dev/null
+++ b/python/tests/crossref.py
@@ -0,0 +1,16 @@
+
+import pytest
+from fatcat.crossref_importer import FatcatCrossrefImporter
+
+
+@pytest.fixture(scope="function")
+def crossref_importer():
+ yield FatcatCrossrefImporter("http://localhost:9411/v0")
+
+def test_crossref_importer_batch(crossref_importer):
+ with open('tests/files/crossref-works.2018-01-21.badsample.json', 'r') as f:
+ crossref_importer.process_batch(f)
+
+def test_crossref_importer(crossref_importer):
+ with open('tests/files/crossref-works.2018-01-21.badsample.json', 'r') as f:
+ crossref_importer.process_source(f)