diff --git a/owslib/util.py b/owslib/util.py index ab6c762b..dadc82cc 100644 --- a/owslib/util.py +++ b/owslib/util.py @@ -208,10 +208,10 @@ def openURL(url_base, data=None, method='Get', cookies=None, username=None, pass req = requests.request(method.upper(), url_base, headers=headers, **rkwargs) - if req.status_code in [400, 401, 403]: + if req.status_code == 400: raise ServiceException(req.text) - if req.status_code in [404, 500, 502, 503, 504]: # add more if needed + if req.status_code in [401, 403, 404, 500, 502, 503, 504]: # add more if needed req.raise_for_status() # check for service exceptions without the http header set diff --git a/tests/test_ogcapi_records_pycsw.py b/tests/test_ogcapi_records_pycsw.py index b7c6b717..1db211ed 100644 --- a/tests/test_ogcapi_records_pycsw.py +++ b/tests/test_ogcapi_records_pycsw.py @@ -40,7 +40,7 @@ def test_ogcapi_records_pycsw(): assert isinstance(w.response, dict) pycsw_cite_demo_queryables = w.collection_queryables('metadata:main') - assert len(pycsw_cite_demo_queryables['properties'].keys()) == 18 + assert len(pycsw_cite_demo_queryables['properties'].keys()) == 19 # Minimum of limit param is 1 with pytest.raises(RuntimeError):