diff --git a/catalog/dags/providers/provider_api_scripts/phylopic.py b/catalog/dags/providers/provider_api_scripts/phylopic.py index 9362e0e7c76..a4233a14546 100644 --- a/catalog/dags/providers/provider_api_scripts/phylopic.py +++ b/catalog/dags/providers/provider_api_scripts/phylopic.py @@ -105,9 +105,9 @@ def get_record_data(self, data: dict) -> dict | list[dict] | None: if not (license_info := get_license_info(license_url)): return None - title = data.get("self", {}).get("title") - creator, creator_url = self._get_creator(data.get("contributor", {})) - width, height = self._get_image_sizes(data) + title = links.get("self", {}).get("title") + creator, creator_url = self._get_creator(links.get("contributor", {})) + width, height = self._get_image_sizes(links) return { "license_info": license_info, diff --git a/catalog/tests/dags/providers/provider_api_scripts/test_flickr.py b/catalog/tests/dags/providers/provider_api_scripts/test_flickr.py index afff1ab4c63..2b84a816b33 100644 --- a/catalog/tests/dags/providers/provider_api_scripts/test_flickr.py +++ b/catalog/tests/dags/providers/provider_api_scripts/test_flickr.py @@ -179,7 +179,7 @@ def test_get_record_data(): [ pytest.param(["owner"], id="owner-foreign_landing_url"), pytest.param(["license"], id="license"), - pytest.param(["url_l", "url_m", "url_s"], id="url_x-image_url"), + pytest.param(["url_l", "url_m", "url_s"], id="url_x-url"), pytest.param(["id"], id="id-foreign_identifier"), ], ) @@ -197,7 +197,7 @@ def test_get_record_data_returns_none_when_missing_required_params(missing_param [ pytest.param(["owner"], id="owner-foreign_landing_url"), pytest.param(["license"], id="license"), - pytest.param(["url_l", "url_m", "url_s"], id="url_x-image_url"), + pytest.param(["url_l", "url_m", "url_s"], id="url_x-url"), pytest.param(["id"], id="id-foreign_identifier"), ], ) diff --git a/catalog/tests/dags/providers/provider_api_scripts/test_museum_victoria.py b/catalog/tests/dags/providers/provider_api_scripts/test_museum_victoria.py index 2778af00cf3..8da26ed7bc2 100644 --- a/catalog/tests/dags/providers/provider_api_scripts/test_museum_victoria.py +++ b/catalog/tests/dags/providers/provider_api_scripts/test_museum_victoria.py @@ -171,11 +171,11 @@ def test_get_image_data(image_size, expected_height, expected_width, expected_fi f"329745-{image_size}.jpg" ) - actual_image_url, actual_height, actual_width, actual_filesize = mv._get_image_data( + actual_url, actual_height, actual_width, actual_filesize = mv._get_image_data( image_data ) - assert actual_image_url == expected_url + assert actual_url == expected_url assert actual_height == expected_height assert actual_width == expected_width assert actual_filesize == expected_filesize @@ -184,11 +184,11 @@ def test_get_image_data(image_size, expected_height, expected_width, expected_fi def test_get_image_data_none(): image_data = {} - actual_image_url, actual_height, actual_width, actual_filesize = mv._get_image_data( + actual_url, actual_height, actual_width, actual_filesize = mv._get_image_data( image_data ) - assert actual_image_url is None + assert actual_url is None assert actual_height is None assert actual_width is None assert actual_filesize is None diff --git a/catalog/tests/dags/providers/provider_api_scripts/test_nypl.py b/catalog/tests/dags/providers/provider_api_scripts/test_nypl.py index ee30770d10f..fd738f5dafd 100644 --- a/catalog/tests/dags/providers/provider_api_scripts/test_nypl.py +++ b/catalog/tests/dags/providers/provider_api_scripts/test_nypl.py @@ -218,7 +218,7 @@ def test_get_record_data_missing_required_params_returns_empty_list( assert images == [] -def test_get_record_data_missing_image_urls_returns_empty_dictionary(): +def test_get_record_data_missing_urls_returns_empty_dictionary(): search_response = _get_resource_json("response_search_success.json") result = search_response["nyplAPI"]["response"]["result"][0] diff --git a/catalog/tests/dags/providers/provider_api_scripts/test_science_museum.py b/catalog/tests/dags/providers/provider_api_scripts/test_science_museum.py index 6e55a13e868..51bb096d3ed 100644 --- a/catalog/tests/dags/providers/provider_api_scripts/test_science_museum.py +++ b/catalog/tests/dags/providers/provider_api_scripts/test_science_museum.py @@ -135,7 +135,7 @@ def test_get_record_data_returns_none_for_falsy_foreign_landing_url_and_multimed "links": {"self": "link"}, "attributes": {"multimedia": [{"admin": {"uid": ""}}]}, }, - # missing image_url + # missing url { "links": {"self": "link"}, "attributes": {"multimedia": [{"admin": {"uid": "fid"}}]}, diff --git a/catalog/tests/dags/providers/provider_api_scripts/test_smk.py b/catalog/tests/dags/providers/provider_api_scripts/test_smk.py index 710ec746ec6..e6530f0f978 100644 --- a/catalog/tests/dags/providers/provider_api_scripts/test_smk.py +++ b/catalog/tests/dags/providers/provider_api_scripts/test_smk.py @@ -150,7 +150,7 @@ def test_get_record_data_returns_main_image(): "height": 5141, "width": 3076, "thumbnail_url": "https://iip-thumb.smk.dk/iiif/jp2/kks1615.tif.jp2/full/!1024,/0/default.jpg", - "image_url": "https://iip.smk.dk/iiif/jp2/kks1615.tif.jp2/full/!2048,/0/default.jpg", + "url": "https://iip.smk.dk/iiif/jp2/kks1615.tif.jp2/full/!2048,/0/default.jpg", "license_info": CC0_SMK, "meta_data": { "collection": "Gammel bestand", @@ -167,7 +167,7 @@ def test_get_record_data_returns_main_image(): pytest.param(["object_number"], id="falsy foreign_landing_url"), pytest.param(["rights"], id="falsy license_info"), # For items with iiif id, the image_url is constructed from it. - pytest.param(["image_native", "image_iiif_id"], id="falsy image_url"), + pytest.param(["image_native", "image_iiif_id"], id="falsy url"), pytest.param(["id", "image_iiif_id"], id="falsy foreign_identifier"), ], ) diff --git a/catalog/tests/dags/providers/provider_api_scripts/test_wordpress.py b/catalog/tests/dags/providers/provider_api_scripts/test_wordpress.py index ec1eb792c8e..2aaf67d9b75 100644 --- a/catalog/tests/dags/providers/provider_api_scripts/test_wordpress.py +++ b/catalog/tests/dags/providers/provider_api_scripts/test_wordpress.py @@ -80,7 +80,7 @@ def test_get_record_data_returns_none_when_necessary_data_is_falsy( assert actual_image_info is None -def test_get_record_data_returns_none_when_no_image_url(ingester): +def test_get_record_data_returns_none_when_no_url(ingester): image_data = _get_resource_json("full_item.json") image_data["_embedded"]["wp:featuredmedia"][0]["media_details"].pop("sizes") actual_image_info = ingester.get_record_data(image_data)