Skip to content

Commit c99a54b

Browse files
committed
Test label:methods summaries, update CHANGELOG
1 parent 6ae120b commit c99a54b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
### Added
66

77
- (Experimental) support for Python 3.10 ([#473](https://github.com/stac-utils/pystac/pull/473))
8+
- `LabelTask` enum in `pystac.extensions.label` with recommended values for
9+
`"label:tasks"` field ([#484](https://github.com/stac-utils/pystac/pull/484))
10+
- `LabelMethod` enum in `pystac.extensions.label` with recommended values for
11+
`"label:methods"` field ([#484](https://github.com/stac-utils/pystac/pull/484))
12+
- Label Extension summaries ([#484](https://github.com/stac-utils/pystac/pull/484))
813

914
### Changed
1015

tests/extensions/test_label.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
LabelExtension,
1111
LabelClasses,
1212
LabelCount,
13+
LabelMethod,
1314
LabelOverview,
1415
LabelStatistics,
1516
LabelTask,
@@ -522,3 +523,20 @@ def test_label_task_summary(self) -> None:
522523
label_tasks_summary_ext = label_ext_summaries.label_tasks
523524
assert label_tasks_summary_ext is not None
524525
self.assertListEqual(label_tasks, label_tasks_summary_ext)
526+
527+
def test_label_methods_summary(self) -> None:
528+
label_methods: List[Union[LabelMethod, str]] = [LabelMethod.AUTOMATED]
529+
collection = Collection.from_file(self.EXAMPLE_COLLECTION)
530+
label_ext_summaries = LabelExtension.summaries(collection)
531+
532+
label_ext_summaries.label_methods = label_methods
533+
534+
summaries = collection.summaries
535+
assert summaries is not None
536+
label_methods_summary = summaries.get_list("label:methods")
537+
assert label_methods_summary is not None
538+
self.assertListEqual(label_methods, label_methods_summary)
539+
540+
label_methods_summary_ext = label_ext_summaries.label_methods
541+
assert label_methods_summary_ext is not None
542+
self.assertListEqual(label_methods, label_methods_summary_ext)

0 commit comments

Comments
 (0)