Skip to content

Commit

Permalink
Add validation test
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan committed Oct 4, 2024
1 parent 54be7dc commit 044540c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_rendering.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from matplotlib.colors import ListedColormap
import pytest

from .utilities import get_content
Expand Down Expand Up @@ -56,6 +57,24 @@ def test_tile_colormap(bahamas, compare, colormap, indexes):
compare(direct_content)


@pytest.mark.parametrize(
"colormap,indexes",
[
(ListedColormap(["red", "blue"]), None),
(ListedColormap(["blue", "green"]), 2),
],
)
def test_custom_colormap(bahamas, compare, colormap, indexes):
# Get a tile over the REST API
tile_url = bahamas.get_tile_url(colormap=colormap, indexes=indexes).format(z=8, x=72, y=110)
rest_content = get_content(tile_url)
# Get tile directly
direct_content = bahamas.tile(z=8, x=72, y=110, colormap=colormap, indexes=indexes)
# Make sure they are the same
assert rest_content == direct_content
compare(direct_content)


@pytest.mark.parametrize("vmin", [100, [100, 200, 250]])
def test_tile_vmin(bahamas, compare, vmin):
url = bahamas.get_tile_url(
Expand Down

0 comments on commit 044540c

Please sign in to comment.