Skip to content

Commit

Permalink
fix tests (#714)
Browse files Browse the repository at this point in the history
* fix

* fix xarray tests
  • Loading branch information
vincentsarago authored Jul 24, 2024
1 parent f59532a commit fbdaff8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/test_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def test_apply_discrete_cmap():
assert colormap.apply_cmap(data, cm)

# Test with negative value
data = data.astype("int16")
cm = {-100: (255, 255, 255, 255), 1: (0, 0, 0, 255), 256: (255, 255, 255, 255)}
data[0, 5:, 5:] = -100
d, m = colormap.apply_cmap(data, cm)
Expand Down
5 changes: 1 addition & 4 deletions tests/test_io_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ def test_xarray_reader():
bounds = tms.xy_bounds(tile)
with pytest.raises(rioxarray.exceptions.OneDimensionalRaster) as error:
dst.tile(tile.x, tile.y, zoom, auto_expand=False)
assert (
str(error.value)
== "At least one of the clipped raster x,y coordinates has only one point."
)
assert "At least one of the clipped raster x,y coordinates" in str(error.value)

# Test that a high-zoom tile will succeed with auto_expand=True (and that is the default)
img = dst.tile(tile.x, tile.y, zoom)
Expand Down

0 comments on commit fbdaff8

Please sign in to comment.