Skip to content

Commit

Permalink
First pass of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpolchlo committed Apr 11, 2023
1 parent a0f8a05 commit ad2d49e
Show file tree
Hide file tree
Showing 4 changed files with 1,446 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pystac/extensions/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ def apply(
self.description = description
self.name = name

assert offset >= 0, "Non-negative offsets only"
assert length >= 1, "Positive field lengths only"

class_coverage = set([c.value for c in classes])
assert set(range(0, 2**length)) - class_coverage == set(), "Classes must cover the complete range of values"

@classmethod
def create(
cls,
Expand Down
Loading

0 comments on commit ad2d49e

Please sign in to comment.