diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-04-04 19:18:05 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-04-04 19:20:17 -0700 |
commit | de46607f0442eea31428e6946b3220a6b94f8926 (patch) | |
tree | 0722183ec4b9aceb36e76f53ba53a05dc3704a41 | |
parent | e0e41462d46b443079b370d296a67f9774f21c55 (diff) | |
download | fatcat-de46607f0442eea31428e6946b3220a6b94f8926.tar.gz fatcat-de46607f0442eea31428e6946b3220a6b94f8926.zip |
ingest tests: check that URL checks actually run
-rw-r--r-- | python/tests/import_ingest.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/python/tests/import_ingest.py b/python/tests/import_ingest.py index 77d237c8..65549d1d 100644 --- a/python/tests/import_ingest.py +++ b/python/tests/import_ingest.py @@ -208,11 +208,15 @@ def test_ingest_fileset_dict_parse(ingest_fileset_importer): == "https://zenodo.org/api/files/563203f6-6de5-46d9-b305-ba42604f2508/N2%20on%20food%20R_2010_03_25__10_53_27___4___1_features.hdf5" ) assert len(fs.urls) == 2 + matched = 0 for u in fs.urls: if u.rel == "web": assert u.url == "https://zenodo.org/record/1028059" + matched += 1 if u.rel == "archive-base": assert u.url == "https://archive.org/download/zenodo.org-1028059/" + matched += 1 + assert matched == 2 assert len(fs.release_ids) == 1 @@ -257,14 +261,18 @@ def test_ingest_fileset_file_dict_parse(ingest_fileset_file_importer): assert fe.size == 410631015 assert fe.extra["path"] == "NDVI_Diff_1990_2018_T06.tif" assert len(fe.urls) == 2 + matched = 0 for u in fe.urls: - if u.rel == "repository": + if u.rel == "web": assert u.url == "https://ndownloader.figshare.com/files/14460875" + matched += 1 if u.rel == "archive": assert ( u.url == "https://archive.org/download/springernature.figshare.com-7767695-v1/NDVI_Diff_1990_2018_T06.tif" ) + matched += 1 + assert matched == 2 assert len(fe.release_ids) == 1 |