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 10, 2022
1 parent aa4a480 commit bb4fd62
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions tests/test_populate_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,23 @@ def should_create_new_root_catalog_if_doesnt_exist(subtests: SubTests, s3_client
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"./{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_CHILD,
STAC_HREF_KEY: f"./{dataset.title}/{catalog_filename}",
STAC_TITLE_KEY: dataset.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
expected_dataset_links: JsonList = [
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_PARENT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
Expand Down Expand Up @@ -228,33 +224,28 @@ def should_update_root_catalog_with_new_version_catalog(subtests: SubTests) -> N
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"./{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_CHILD,
STAC_HREF_KEY: f"./{dataset.title}/{catalog_filename}",
STAC_TITLE_KEY: dataset.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
expected_dataset_version_links: JsonList = [
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_CHILD,
STAC_HREF_KEY: f"./{collection_filename}",
STAC_TITLE_KEY: dataset.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_PARENT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
Expand Down Expand Up @@ -353,21 +344,18 @@ def should_update_root_catalog_with_new_version_collection(subtests: SubTests) -
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"./{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_CHILD,
STAC_HREF_KEY: f"./{dataset.title}/{collection_filename}",
STAC_TITLE_KEY: dataset.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
expected_dataset_version_links: JsonList = [
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
Expand All @@ -378,21 +366,18 @@ def should_update_root_catalog_with_new_version_collection(subtests: SubTests) -
{
STAC_REL_KEY: STAC_REL_PARENT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
expected_item_links: JsonList = [
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_PARENT,
STAC_HREF_KEY: f"./{collection_filename}",
STAC_TITLE_KEY: dataset.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
Expand Down Expand Up @@ -475,27 +460,23 @@ def should_not_add_duplicate_child_link_to_root(subtests: SubTests) -> None:
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"./{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_CHILD,
STAC_HREF_KEY: f"./{dataset.title}/{catalog_filename}",
STAC_TITLE_KEY: dataset.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
expected_dataset_version_links: JsonList = [
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_PARENT,
STAC_HREF_KEY: f"../{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
Expand Down Expand Up @@ -602,25 +583,21 @@ def should_add_link_to_root_catalog_in_series(
{
STAC_REL_KEY: STAC_REL_ROOT,
STAC_HREF_KEY: f"./{CATALOG_FILENAME}",
STAC_TITLE_KEY: ROOT_CATALOG_TITLE,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_CHILD,
STAC_HREF_KEY: f"./{dataset_one.title}/{catalog_filename}",
STAC_TITLE_KEY: dataset_one.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_CHILD,
STAC_HREF_KEY: f"./{dataset_two.title}/{catalog_filename}",
STAC_TITLE_KEY: dataset_two.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
{
STAC_REL_KEY: STAC_REL_CHILD,
STAC_HREF_KEY: f"./{dataset_three.title}/{catalog_filename}",
STAC_TITLE_KEY: dataset_three.title,
STAC_TYPE_KEY: STAC_MEDIA_TYPE_JSON,
},
]
Expand Down

0 comments on commit bb4fd62

Please sign in to comment.