Repository: fractal-analytics-platform/fractal-tasks-core (language: python)

Issue:
Revert Zenodo-API update
Zenodo reverted their recent API changes, without communicating it - as far as I could observe.
We need to revert the API-changes-related part of https://github.com/fractal-analytics-platform/fractal-tasks-core/pull/568.

Refs:
* https://github.com/zenodo/zenodo/issues/2486
* https://github.com/fatiando/pooch/issues/371
* https://github.com/fatiando/pooch/pull/373
* https://github.com/fatiando/pooch/pull/375
* https://github.com/dvolgyes/zenodo_get/issues/19
* https://inveniordm.docs.cern.ch/reference/rest_api_drafts_records/#get-a-record


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 467983a23..90be81765 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 **Note**: Numbers like (\#123) point to closed Pull Requests on the fractal-tasks-core repository.
 
+# Unreleased
+
+* Testing:
+    * Align with new Zenodo API (\#601).
+
 # 0.13.1
 
 * Always use `write_table` in tasks, rather than AnnData `write_elem` (\#581).


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index f2a0eeac6..d87c5a65f 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -43,7 +43,7 @@ def zenodo_images(testdata_path):
         js = json.loads(r.text)
         files = js["files"]
         for f in files:
-            file_url = f["links"]["download"]
+            file_url = f["links"]["self"]
             file_name = file_url.split("/")[-2]
             wget.download(file_url, out=f"{folder}/{file_name}", bar=False)
 
diff --git a/tests/data/download_zenodo_data.sh b/tests/data/download_zenodo_data.sh
index c6e868c34..c95656b3e 100644
--- a/tests/data/download_zenodo_data.sh
+++ b/tests/data/download_zenodo_data.sh
@@ -13,7 +13,7 @@ for RECORD_ID in $LIST_RECORD_ID; do
         echo "OUTPUT_FOLDER already exists. Exit."
     else
         mkdir $OUTPUT_FOLDER
-        FILES=`curl https://zenodo.org/api/records/$RECORD_ID | jq -r ".files[].links.download"`
+        FILES=`curl https://zenodo.org/api/records/$RECORD_ID | jq -r ".files[].links.self"`
         echo "curl exit code: $?"
         echo
         for FILE in $FILES; do