Skip to content

Commit ed9966f

Browse files
committed
Improve test coverage
1 parent 5fa385c commit ed9966f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_item.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,15 @@ def test_non_hierarchical_relative_link() -> None:
617617
root.add_child(a)
618618
root.add_child(b)
619619
a.add_link(pystac.Link("related", b))
620+
b.add_link(
621+
pystac.Link("item", TestCases.get_path("data-files/item/sample-item.json"))
622+
)
620623

621624
root.catalog_type = pystac.catalog.CatalogType.SELF_CONTAINED
622625
root.normalize_hrefs("test_output")
623626
related_href = [link for link in a.links if link.rel == "related"][0].get_href()
624627

625628
assert related_href is not None and not is_absolute_href(related_href)
629+
assert a.target_in_hierarchy(b)
630+
assert root.target_in_hierarchy(next(b.get_items()))
631+
assert root.target_in_hierarchy(root)

0 commit comments

Comments
 (0)