Skip to content

Commit

Permalink
test(wms): add test case for #416
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasschaub committed Apr 15, 2024
1 parent 3578f4f commit d5e6966
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/unit/test_wms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from PIL.PngImagePlugin import PngImageFile

from sketch_map_tool.models import Bbox, Layer, Size
from sketch_map_tool.wms import client
from tests import vcr_app as vcr

Expand All @@ -16,3 +17,22 @@ def test_as_image(bbox, size, layer):
image = client.as_image(response)
# image.show() # for showing of the image during manual testing
assert isinstance(image, PngImageFile)


# @vcr.use_cassette
def test_as_image_could_not_get_any_sources(bbox, size, layer):
"""Test case covering issue described in #416"""
bbox = Bbox(
*[
3115430.61527546,
859273.1634149066,
3116705.00304079,
860339.8395431428,
]
)
size = Size(**{"width": 1716, "height": 1436})
layer = Layer("esri-world-imagery")
response = client.get_map_image(bbox, size, layer)
image = client.as_image(response)
image.show() # for showing of the image during manual testing
assert isinstance(image, PngImageFile)

0 comments on commit d5e6966

Please sign in to comment.