Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jun 9, 2022
1 parent fabd530 commit b9b029d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Binary file added tests/fixtures/dataset_int16_nodata.tif
Binary file not shown.
11 changes: 11 additions & 0 deletions tests/test_create_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"dataset_gcps.tif",
"issue_22.tif",
"dataset_dateline.tif",
"dataset_int16_nodata.tif",
],
)
def test_create_item(file):
Expand Down Expand Up @@ -254,3 +255,13 @@ def test_dateline_polygon_split():
)
item_dict = item.to_dict()
assert item_dict["geometry"]["type"] == "MultiPolygon"


def test_negative_nodata():
"""Make sure we catch valid nodata (issue 33)."""
src_path = os.path.join(PREFIX, "dataset_int16_nodata.tif")
item = create_stac_item(
src_path, input_datetime=input_date, with_raster=True, with_proj=True
)
item_dict = item.to_dict()
assert item_dict["assets"]["asset"]["raster:bands"][0]["nodata"] == -9999

0 comments on commit b9b029d

Please sign in to comment.