File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -476,14 +476,9 @@ def from_dict(
476
476
assets = {k : Asset .from_dict (v ) for k , v in assets .items ()},
477
477
)
478
478
479
- has_self_link = False
480
479
for link in links :
481
- has_self_link |= link ["rel" ] == pystac .RelType .SELF
482
480
item .add_link (Link .from_dict (link ))
483
481
484
- if not has_self_link and href is not None :
485
- item .add_link (Link .self_href (href ))
486
-
487
482
if root :
488
483
item .set_root (root )
489
484
Original file line number Diff line number Diff line change @@ -33,3 +33,8 @@ def test_case_1_catalog() -> Catalog:
33
33
def projection_landsat8_item () -> Item :
34
34
path = TestCases .get_path ("data-files/projection/example-landsat8.json" )
35
35
return Item .from_file (path )
36
+
37
+
38
+ @pytest .fixture
39
+ def sample_item () -> Item :
40
+ return Item .from_file (TestCases .get_path ("data-files/item/sample-item.json" ))
Original file line number Diff line number Diff line change @@ -468,3 +468,8 @@ def test_geo_interface() -> None:
468
468
item .to_dict (include_self_link = False , transform_hrefs = False )
469
469
== item .__geo_interface__
470
470
)
471
+
472
+
473
+ def test_duplicate_self_links (sample_item : pystac .Item ) -> None :
474
+ # https://github.com/stac-utils/pystac/issues/1102
475
+ assert len (sample_item .get_links (rel = "self" )) == 1
You can’t perform that action at this time.
0 commit comments