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.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/python/tests/import_journal_metadata.py b/python/tests/import_journal_metadata.py
index 1663da05..a2b10a65 100644
--- a/python/tests/import_journal_metadata.py
+++ b/python/tests/import_journal_metadata.py
@@ -17,7 +17,10 @@ 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:
journal_metadata_importer.bezerk_mode = True
- CsvPusher(journal_metadata_importer, f).run()
+ counts = CsvPusher(journal_metadata_importer, f).run()
+ assert counts['insert'] == 9
+ assert counts['exists'] == 0
+ assert counts['skip'] == 0
# fetch most recent editgroup
change = journal_metadata_importer.api.get_changelog_entry(index=last_index+1)
@@ -26,3 +29,11 @@ def test_journal_metadata_importer(journal_metadata_importer):
assert "container" in eg.description.lower()
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:
+ journal_metadata_importer.reset()
+ journal_metadata_importer.bezerk_mode = False
+ counts = CsvPusher(journal_metadata_importer, f).run()
+ assert counts['insert'] == 0
+ assert counts['exists'] == 9
+ assert counts['skip'] == 0