Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Commit

Permalink
fix: Ignore optional title links in tests
Browse files Browse the repository at this point in the history
Pystac offers optional title field in link object (human-readable title to be used in rendered displays of the link). Removing normalized_href (put in place to solve #1818) causes tests to fail due to missing title.
  • Loading branch information
Jimlinz committed Aug 11, 2022
1 parent c0627fd commit 93ec75e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_populate_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ def should_update_root_catalog_with_new_version_catalog(subtests: SubTests) -> N
mode="rb",
) as updated_dataset_metadata_file:
version_json = load(updated_dataset_metadata_file)
for index in range(len(version_json[STAC_LINKS_KEY])):
if "title" in version_json[STAC_LINKS_KEY][index]:
expected_dataset_version_links[index]["title"] = version_json[STAC_LINKS_KEY][
index
]["title"]
else:
expected_dataset_version_links[index].pop("title")
assert version_json[STAC_LINKS_KEY] == expected_dataset_version_links


Expand Down Expand Up @@ -422,6 +429,11 @@ def should_update_root_catalog_with_new_version_collection(subtests: SubTests) -
mode="rb",
) as updated_item_metadata_file:
item_json = load(updated_item_metadata_file)
for index in range(len(item_json[STAC_LINKS_KEY])):
if "title" in item_json[STAC_LINKS_KEY][index]:
expected_item_links[index]["title"] = item_json[STAC_LINKS_KEY][index]["title"]
else:
expected_item_links[index].pop("title")
assert item_json[STAC_LINKS_KEY] == expected_item_links


Expand Down

0 comments on commit 93ec75e

Please sign in to comment.