aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-04-12 17:28:16 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-04-12 17:35:53 -0700
commit4abb99c545c3d4af91f98715708fc58310f70f03 (patch)
tree708614adbf9623361b60f327652ddc7499f94976
parent7a106645f663db71020baaec147abbac896613ce (diff)
downloadfatcat-4abb99c545c3d4af91f98715708fc58310f70f03.tar.gz
fatcat-4abb99c545c3d4af91f98715708fc58310f70f03.zip
make dblp tests more robust
These were causing a lot of spurious errors in local development. Not sure these tweaks will entirely fix the problem.
-rw-r--r--python/tests/import_dblp.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/python/tests/import_dblp.py b/python/tests/import_dblp.py
index d6b5878d..340e6237 100644
--- a/python/tests/import_dblp.py
+++ b/python/tests/import_dblp.py
@@ -44,6 +44,12 @@ def test_dblp_importer(dblp_importer):
# check that entity name mangling was fixed on import
eg = dblp_importer.api.get_editgroup(eg.editgroup_id)
release = dblp_importer.api.get_release(eg.edits.releases[0].ident)
+ for r_edit in eg.edits.releases:
+ release = dblp_importer.api.get_release(r_edit.ident)
+ #print(release.ext_ids.dblp)
+ if release.ext_ids.dblp == "conf/er/Norrie08":
+ break
+ assert release.ext_ids.dblp == "conf/er/Norrie08"
assert release.contribs[0].raw_name == "Moira C. Norrie"
assert release.contribs[1].raw_name == "Michael H. Böhlen"
@@ -79,7 +85,10 @@ def test_dblp_container_importer(dblp_container_importer):
# check that entity name mangling was fixed on import
eg = dblp_container_importer.api.get_editgroup(eg.editgroup_id)
- container = dblp_container_importer.api.get_container(eg.edits.containers[0].ident)
+ for c_edit in eg.edits.containers:
+ container = dblp_container_importer.api.get_container(c_edit.ident)
+ if container.issnl == "1877-3273":
+ break
assert container.name == "Atlantis Thinking Machines"
assert container.issnl == "1877-3273"
assert container.container_type == "book-series"
@@ -88,7 +97,7 @@ def test_dblp_container_importer(dblp_container_importer):
last_index = dblp_container_importer.api.get_changelog(limit=1)[0].index
output_tsv_map.seek(0)
- print(output_tsv_map.read())
+ #print(output_tsv_map.read())
output_tsv_map.seek(0)
with open('tests/files/example_dblp_containers.json', 'r') as f:
dblp_container_importer.reset()