Skip to content

Commit

Permalink
add a test for stac-utils#1483
Browse files Browse the repository at this point in the history
  • Loading branch information
remicres committed Dec 16, 2024
1 parent 9d61c86 commit b2a42f3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/extensions/test_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,23 @@ def test_apply_bitfields(plain_item: Item) -> None:
)


@pytest.mark.vcr()
def test_apply_classes(plain_item: Item) -> None:
ClassificationExtension.add_to(plain_item)
ClassificationExtension.ext(plain_item).apply(
classes=[
Classification.create(name="no", value=0),
Classification.create(name="yes", value=1),
]
)
plain_item.validate()
assert (
ClassificationExtension.ext(plain_item).classes is not None
and len(cast(list[Classification], ClassificationExtension.ext(plain_item).classes))
== 2
)


def test_create_classes(plain_item: Item) -> None:
ClassificationExtension.add_to(plain_item)
ext = ClassificationExtension.ext(plain_item)
Expand Down

0 comments on commit b2a42f3

Please sign in to comment.