aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-17 13:48:59 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-17 13:48:59 -0800
commit8a36af1664f0399f29a57b639dc0c89033578878 (patch)
treecb35bd1fdf329431820db688dd94b62c842d9ac5 /python/tests
parent3c56a6c8da155f4675e48a6f5fa55b1cf9fb096a (diff)
downloadfatcat-8a36af1664f0399f29a57b639dc0c89033578878.tar.gz
fatcat-8a36af1664f0399f29a57b639dc0c89033578878.zip
issn => journal_metadata in several places
Diffstat (limited to 'python/tests')
-rw-r--r--python/tests/import_issn.py26
-rw-r--r--python/tests/import_journal_metadata.py26
2 files changed, 26 insertions, 26 deletions
diff --git a/python/tests/import_issn.py b/python/tests/import_issn.py
deleted file mode 100644
index 6b5978d9..00000000
--- a/python/tests/import_issn.py
+++ /dev/null
@@ -1,26 +0,0 @@
-
-import pytest
-from fatcat_tools.importers import IssnImporter
-from fixtures import api
-
-
-@pytest.fixture(scope="function")
-def issn_importer(api):
- yield IssnImporter(api)
-
-# TODO: use API to check that entities actually created...
-def test_issn_importer_batch(issn_importer):
- with open('tests/files/journal_extra_metadata.snip.csv', 'r') as f:
- issn_importer.process_csv_batch(f)
-
-def test_issn_importer(issn_importer):
- with open('tests/files/journal_extra_metadata.snip.csv', 'r') as f:
- issn_importer.process_csv_source(f)
-
- # fetch most recent editgroup
- changes = issn_importer.api.get_changelog(limit=1)
- eg = changes[0].editgroup
- assert eg.description
- assert "container" in eg.description.lower()
- assert eg.extra['git_rev']
- assert "fatcat_tools.IssnImporter" in eg.extra['agent']
diff --git a/python/tests/import_journal_metadata.py b/python/tests/import_journal_metadata.py
new file mode 100644
index 00000000..81334bc6
--- /dev/null
+++ b/python/tests/import_journal_metadata.py
@@ -0,0 +1,26 @@
+
+import pytest
+from fatcat_tools.importers import JournalMetadataImporter
+from fixtures import api
+
+
+@pytest.fixture(scope="function")
+def journal_metadata_importer(api):
+ yield JournalMetadataImporter(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:
+ journal_metadata_importer.process_csv_batch(f)
+
+def test_journal_metadata_importer(journal_metadata_importer):
+ with open('tests/files/journal_extra_metadata.snip.csv', 'r') as f:
+ journal_metadata_importer.process_csv_source(f)
+
+ # fetch most recent editgroup
+ changes = journal_metadata_importer.api.get_changelog(limit=1)
+ eg = changes[0].editgroup
+ assert eg.description
+ assert "container" in eg.description.lower()
+ assert eg.extra['git_rev']
+ assert "fatcat_tools.JournalMetadataImporter" in eg.extra['agent']