Skip to content

Commit

Permalink
Python: add test for count with default_value
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Aug 13, 2024
1 parent e232578 commit afb834b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/tests/test_exact_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ def test_default_value():
rast,
square,
[
"count",
"count_with_default=count(default_value=0)",
"sum",
"sum_with_default=sum(default_value=123)",
"mean",
Expand All @@ -487,6 +489,8 @@ def test_default_value():
substituted = np.where(data == -99, 123, data)

assert results[0]["properties"] == {
"count": (~masked.mask).sum(),
"count_with_default": substituted.size,
"sum": masked.sum(),
"sum_with_default": substituted.sum(),
"mean": masked.mean(),
Expand Down

0 comments on commit afb834b

Please sign in to comment.