11from owslib .wfs import WebFeatureService
22from owslib .util import ServiceException
33from owslib .fes import PropertyIsLike , etree
4- from urllib .parse import urlparse
54from tests .utils import resource_file , sorted_url_query , service_ok
65import json
76import pytest
87
98SERVICE_URL = 'https://services.ga.gov.au/gis/stratunits/ows'
109
10+
1111def test_caps_info ():
1212 getcapsin = open (resource_file ("wfs_HSRS_GetCapabilities_1_1_0.xml" ), "rb" ).read ()
1313 wfs = WebFeatureService ('http://gis.bnhelp.cz/ows/crwfs' , xml = getcapsin , version = '1.1.0' )
@@ -143,17 +143,6 @@ def test_srsname_wfs_200():
143143 assert len (json .loads (feature .read ())['features' ]) == 1
144144
145145
146- @pytest .mark .online
147- @pytest .mark .skipif (not service_ok (SERVICE_URL ),
148- reason = "WFS service is unreachable" )
149- def test_schema_wfs_100 ():
150- wfs = WebFeatureService (SERVICE_URL , version = '1.0.0' )
151- schema = wfs .get_schema ('stratunit:StratigraphicUnit' )
152- assert len (schema ['properties' ]) == 33
153- assert schema ['properties' ]['DESCRIPTION' ] == 'string'
154- assert schema ['geometry' ] is None
155-
156-
157146@pytest .mark .online
158147@pytest .mark .skipif (not service_ok (SERVICE_URL ),
159148 reason = "WFS service is unreachable" )
@@ -183,7 +172,7 @@ def test_schema_wfs_200():
183172def test_xmlfilter_wfs_110 ():
184173 wfs = WebFeatureService (SERVICE_URL , version = '1.1.0' )
185174 filter_prop = PropertyIsLike (propertyname = 'stratunit:GEOLOGICHISTORY' , literal = 'Cisuralian - Guadalupian' ,
186- matchCase = True )
175+ matchCase = True )
187176
188177 filterxml = etree .tostring (filter_prop .toXML ()).decode ("utf-8" )
189178
@@ -200,12 +189,11 @@ def test_xmlfilter_wfs_110():
200189def test_xmlfilter_wfs_200 ():
201190 wfs = WebFeatureService (SERVICE_URL , version = '2.0.0' )
202191 filter_prop = PropertyIsLike (propertyname = 'stratunit:geologichistory' , literal = 'Cisuralian - Guadalupian' ,
203- matchCase = True )
192+ matchCase = True )
204193
205194 filterxml = etree .tostring (filter_prop .toXML ()).decode ("utf-8" )
206195
207196 getfeat_params = {'typename' : 'stratunit:StratigraphicUnit' , 'filter' : filterxml }
208197
209198 response = wfs .getfeature (** getfeat_params ).read ()
210199 assert b'<stratunit:NAME>Boolgeeda Iron Formation</stratunit:NAME>' in response
211-
0 commit comments