summaryrefslogtreecommitdiffstats
path: root/python/tests/import_journal_metadata.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests/import_journal_metadata.py')
-rw-r--r--python/tests/import_journal_metadata.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/python/tests/import_journal_metadata.py b/python/tests/import_journal_metadata.py
index a2b10a65..cfeee517 100644
--- a/python/tests/import_journal_metadata.py
+++ b/python/tests/import_journal_metadata.py
@@ -1,6 +1,6 @@
import pytest
-from fatcat_tools.importers import JournalMetadataImporter, CsvPusher
+from fatcat_tools.importers import JournalMetadataImporter, JsonLinePusher
from fixtures import api
@@ -10,15 +10,15 @@ def journal_metadata_importer(api):
# TODO: use API to check that entities actually created...
def test_journal_metadata_importer_batch(journal_metadata_importer):
- with open('tests/files/journal_extra_metadata.snip.csv', 'r') as f:
- CsvPusher(journal_metadata_importer, f).run()
+ with open('tests/files/journal_metadata.sample.json', 'r') as f:
+ JsonLinePusher(journal_metadata_importer, f).run()
def test_journal_metadata_importer(journal_metadata_importer):
last_index = journal_metadata_importer.api.get_changelog(limit=1)[0].index
- with open('tests/files/journal_extra_metadata.snip.csv', 'r') as f:
+ with open('tests/files/journal_metadata.sample.json', 'r') as f:
journal_metadata_importer.bezerk_mode = True
- counts = CsvPusher(journal_metadata_importer, f).run()
- assert counts['insert'] == 9
+ counts = JsonLinePusher(journal_metadata_importer, f).run()
+ assert counts['insert'] == 20
assert counts['exists'] == 0
assert counts['skip'] == 0
@@ -30,10 +30,10 @@ def test_journal_metadata_importer(journal_metadata_importer):
assert eg.extra['git_rev']
assert "fatcat_tools.JournalMetadataImporter" in eg.extra['agent']
- with open('tests/files/journal_extra_metadata.snip.csv', 'r') as f:
+ with open('tests/files/journal_metadata.sample.json', 'r') as f:
journal_metadata_importer.reset()
journal_metadata_importer.bezerk_mode = False
- counts = CsvPusher(journal_metadata_importer, f).run()
+ counts = JsonLinePusher(journal_metadata_importer, f).run()
assert counts['insert'] == 0
- assert counts['exists'] == 9
+ assert counts['exists'] == 20
assert counts['skip'] == 0