Skip to content

Commit

Permalink
Clean up coverage test
Browse files Browse the repository at this point in the history
  • Loading branch information
pindge committed Jul 1, 2020
1 parent 2f631a3 commit 13b8d8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
1 change: 0 additions & 1 deletion integration_tests/test_wcs_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from owslib.util import ServiceException
from urllib import request
from lxml import etree
from imghdr import what
import requests

def get_xsd(name):
Expand Down
5 changes: 2 additions & 3 deletions integration_tests/test_wms_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from owslib.wms import WebMapService
from urllib import request
from lxml import etree
from imghdr import what
import requests

def get_xsd(name):
Expand Down Expand Up @@ -117,7 +116,7 @@ def test_wms_getmap(ows_server):
time=test_layer.timepositions[len(test_layer.timepositions) // 2].strip(),
)
assert img
assert what("", h=img.read()) == "png"
assert img.info()['Content-Type'] == 'image/png'

img = wms.getmap(layers=[test_layer_name],
styles=[],
Expand All @@ -129,7 +128,7 @@ def test_wms_getmap(ows_server):
time=test_layer.timepositions[len(test_layer.timepositions) // 2].strip(),
)
assert img
assert what("", h=img.read()) == "png"
assert img.info()['Content-Type'] == 'image/png'


def test_wms_getfeatureinfo(ows_server):
Expand Down
17 changes: 13 additions & 4 deletions integration_tests/test_wmts_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from owslib.util import ServiceException
from urllib import request
from lxml import etree
from imghdr import what

def get_xsd(name):
# since this function is only being called by getcapabilities set to wmts/1.0.0
Expand Down Expand Up @@ -45,7 +44,7 @@ def test_getcap_badsvc(ows_server):


@pytest.mark.xfail(reason="OWS Getcaps don't pass XSD")
def test_getcap(ows_server):
def test_wmts_getcap(ows_server):
resp = request.urlopen(ows_server.url + "/wmts?request=GetCapabilities&service=WMTS&version=1.0.0", timeout=10)

# Confirm success
Expand All @@ -57,6 +56,17 @@ def test_getcap(ows_server):
assert gc_xds.validate(resp_xml)


def test_wmts_getcap_section(ows_server):
section_options = ['all', 'serviceidentification', 'serviceprovider', 'operationsmetadata', 'contents', 'themes']
for section in section_options:
resp = request.urlopen(ows_server.url + "/wmts?request=GetCapabilities&service=WMTS&version=1.0.0&section={}".format(
section
), timeout=10)

# Confirm success
assert resp.code == 200


def test_wmts_server(ows_server):
# Use owslib to confirm that we have a somewhat compliant WCS service
wmts = WebMapTileService(url=ows_server.url+"/wmts")
Expand Down Expand Up @@ -84,8 +94,7 @@ def test_wmts_gettile(ows_server):
)

assert tile
assert what("", h=tile.read()) == "png"

assert tile.info()['Content-Type'] == 'image/png'

def test_wmts_gettile_exception(ows_server):
wmts = WebMapTileService(url=ows_server.url+"/wmts")
Expand Down

0 comments on commit 13b8d8d

Please sign in to comment.