Skip to content

Commit

Permalink
Merge f66c028 into 0931b0c
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Sep 6, 2023
2 parents 0931b0c + f66c028 commit 2f08b11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_ogcapi_processes_pygeoapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_ogcapi_processes_pygeoapi():
assert len(collections) > 0

processes = p.processes()
assert len(processes) == 6
assert len(processes) == 5

hello_world = p.process('hello-world')
assert hello_world['id'] == 'hello-world'
Expand Down
13 changes: 8 additions & 5 deletions tests/test_wmts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_wmts():
tilematrixset='EPSG4326_250m', tilematrix='0',
row=0, column=0, format="image/jpeg")
out = open(scratch_file('nasa_modis_terra_truecolour.jpg'), 'wb')
bytes_written = out.write(tile.read())
_ = out.write(tile.read())
out.close()
# Test styles for several layers
# TODO: fix dict order
Expand All @@ -56,7 +56,7 @@ def test_wmts_example_build_tile_request():
tilematrixset='EPSG4326_500m',
tilematrix='6',
row=4, column=4)
request = 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&\
_ = 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&\
LAYER=VIIRS_CityLights_2012&STYLE=default&TILEMATRIXSET=EPSG4326_500m&\
TILEMATRIX=6&TILEROW=4&TILECOL=4&FORMAT=image%2Fjpeg'

Expand All @@ -76,13 +76,16 @@ def test_wmts_example_get_title():
tilematrix='6',
row=4, column=4)
out = open('tile.jpg', 'wb')
bytes_written = out.write(img.read())
_ = out.write(img.read())
out.close()


EXAMPLE_SERVICE_URL = "http://tile.informatievlaanderen.be/ws/raadpleegdiensten/wmts"


@pytest.mark.online
@pytest.mark.skipif(not service_ok(EXAMPLE_SERVICE_URL),
reason="WMTS service is unreachable")
def test_wmts_example_informatievlaanderen():
wmts = WebMapTileService(EXAMPLE_SERVICE_URL)
assert wmts.identification.type == 'OGC:WMTS'
Expand All @@ -97,7 +100,7 @@ def test_wmts_example_informatievlaanderen():
def test_wmts_without_serviceprovider_tag():
# Test a WMTS without a ServiceProvider tag in Capababilities XML
from owslib.wmts import WebMapTileService
wmts = WebMapTileService(SERVICE_URL_ARCGIS)
_ = WebMapTileService(EXAMPLE_SERVICE_URL)


SERVICE_URL_REST = 'https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml'
Expand All @@ -111,4 +114,4 @@ def test_wmts_rest_only():
from owslib.wmts import WebMapTileService
wmts = WebMapTileService(SERVICE_URL_REST)
tile = wmts.gettile(layer="bmaporthofoto30cm", tilematrix="10", row=357, column=547)
assert(tile.info()['Content-Type'] == 'image/jpeg')
assert tile.info()['Content-Type'] == 'image/jpeg'

0 comments on commit 2f08b11

Please sign in to comment.