Skip to content

Commit e35775f

Browse files
committed
adapt to asset using type instead of media_type
1 parent eff2f50 commit e35775f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

tests/v1/test_catalog.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -988,14 +988,13 @@ def asset_mapper(key: str, asset: pystac.Asset) -> pystac.Asset:
988988
assert asset.title != "NEW TITLE"
989989
assert found
990990

991-
@pytest.mark.xfail(reason=".media_type replaced with .type")
992991
def test_map_assets_tup(self) -> None:
993992
changed_assets: list[str] = []
994993

995994
def asset_mapper(
996995
key: str, asset: pystac.Asset
997996
) -> pystac.Asset | tuple[str, pystac.Asset]:
998-
if asset.media_type and "geotiff" in asset.media_type:
997+
if asset.type and "geotiff" in asset.type:
999998
asset.title = "NEW TITLE"
1000999
changed_assets.append(key)
10011000
return (f"{key}-modified", asset)
@@ -1026,14 +1025,13 @@ def asset_mapper(
10261025
assert found
10271026
assert not_found
10281027

1029-
@pytest.mark.xfail(reason=".media_type replaced with .type")
10301028
def test_map_assets_multi(self) -> None:
10311029
changed_assets = []
10321030

10331031
def asset_mapper(
10341032
key: str, asset: pystac.Asset
10351033
) -> pystac.Asset | dict[str, pystac.Asset]:
1036-
if asset.media_type and "geotiff" in asset.media_type:
1034+
if asset.type and "geotiff" in asset.type:
10371035
changed_assets.append(key)
10381036
mod1 = asset.clone()
10391037
mod1.title = "NEW TITLE 1"

0 commit comments

Comments
 (0)