diff --git a/tests/unit/test_wms.py b/tests/unit/test_wms.py index 4720e86fc..593af8fd3 100644 --- a/tests/unit/test_wms.py +++ b/tests/unit/test_wms.py @@ -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 @@ -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)