Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ on: [ push, pull_request ]

jobs:
main:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- python-version: 3.7
# - python-version: 3.8
- python-version: 3.10.12
steps:
- name: Checkout ✅
uses: actions/checkout@v2
Expand All @@ -27,7 +26,6 @@ jobs:
- name: Install Requirements 📦
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r requirements.txt
pip install -r requirements-dev.txt

Expand Down
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ sphinx:
python:
install:
- requirements: docs/requirements.txt

formats:
- pdf
10 changes: 9 additions & 1 deletion GeoHealthCheck/plugins/probe/wfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WfsGetFeatureBbox(Probe):
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Query typeName="{type_name}" srsName="{srs}"
<wfs:Query typeName="{type_name}" srsName="{srs}" maxFeatures="{max_count}"
xmlns:{type_ns_prefix}="{type_ns_uri}">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:BBOX>
Expand Down Expand Up @@ -77,6 +77,14 @@ class WfsGetFeatureBbox(Probe):
'required': True,
'range': None
},
'max_count': {
'type': 'string',
'description': 'Maximum amount of features to select',
'default': '5',
'value': '5',
'required': True,
'range': None
},
'bbox': {
'type': 'bbox',
'description': 'The tile image extension',
Expand Down
3 changes: 2 additions & 1 deletion pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ def setup():

# install leafletjs to static/lib
info('Getting leaflet')
leafletjs = 'http://cdn.leafletjs.com/downloads/leaflet-0.7.5.zip'
leaflet_cdn_url = 'https://leafletjs-cdn.s3.amazonaws.com/content/leaflet'
leafletjs = '{}/v1.9.4/leaflet.zip'.format(leaflet_cdn_url)

zipstr = BytesIO(urlopen(leafletjs).read())
zipfile_obj = zipfile.ZipFile(zipstr)
Expand Down
12 changes: 12 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Unit Tests

Unit tests are run with the built-in Python module `unittest`.

Fastest way to run, best in a Virtual Environment:

`python3 run_tests.py`

Or using the Docker Image:

`docker run --entrypoint "/run-tests.sh" geopython/geohealthcheck:latest`

96 changes: 43 additions & 53 deletions tests/data/fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"pdok"
]
},
"WOUDC WFS": {
"RCE WFS": {
"owner": "admin",
"resource_type": "OGC:WFS",
"active": true,
"title": "WOUDC Web Feature Service",
"url": "http://geo.woudc.org/ows",
"title": "RCE - Rijksdienst Cultureel Erfgoed WFS",
"url": "https://services.rce.geovoorziening.nl/landschapsatlas/wfs",
"tags": [
"ows"
]
Expand All @@ -47,45 +47,33 @@
"pdok"
]
},
"WOUDC CSW": {
"PDOK CSW": {
"owner": "admin",
"resource_type": "OGC:CSW",
"active": true,
"title": "WOUDC Catalogue Service",
"url": "http://geo.woudc.org/csw",
"title": "PDOK Catalogue Service",
"url": "https://nationaalgeoregister.nl/geonetwork/srv/dut/csw",
"tags": [
"ows"
]
},
"PDOK CP WMTS": {
"PDOK BRK WMTS": {
"owner": "admin",
"resource_type": "OGC:WMTS",
"active": true,
"title": "Dutch Kadaster PDOK BRT WMTS",
"title": "Dutch Kadaster PDOK BRK WMTS",
"url": "https://service.pdok.nl/kadaster/kadastralekaart/wmts/v5_0",
"tags": [
"ows",
"tiling"
]
},
"PDOK BRT WMTS": {
"owner": "admin",
"resource_type": "OGC:WMTS",
"active": true,
"title": "Dutch PDOK Luchtfoto WMTS",
"url": "https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0",
"tags": [
"ows",
"tiling",
"pdok"
]
},
"WOUDC LINK": {
"owner": "admin",
"resource_type": "WWW:LINK",
"active": true,
"title": "WOUDC Definitions Service",
"url": "http://geo.woudc.org/def",
"title": "WOUDC Landing Page",
"url": "https://api.woudc.org/",
"tags": []
},
"OPENGEOGROEP TMS": {
Expand Down Expand Up @@ -162,8 +150,8 @@
"drilldown_level": "minor"
}
},
"WOUDC WFS - GetCaps": {
"resource": "WOUDC WFS",
"RCE WFS - GetCaps": {
"resource": "RCE WFS",
"probe_class": "GeoHealthCheck.plugins.probe.owsgetcaps.WfsGetCaps",
"parameters": {
"service": "WFS",
Expand All @@ -178,6 +166,7 @@
"type_ns_prefix": "bag",
"type_ns_uri": "http://bag.geonovum.nl",
"srs": "EPSG:28992",
"max_count": "1",
"bbox": ["180635", "455870", "180961", "456050"]
}
},
Expand All @@ -189,27 +178,28 @@
"type_ns_prefix": "bag",
"type_ns_uri": "http://bag.geonovum.nl",
"srs": "EPSG:28992",
"max_count": "1",
"bbox": ["180635", "455870", "180961", "456050"]
}
},
"WOUDC CSW - GetCaps": {
"resource": "WOUDC CSW",
"PDOK CSW - GetCaps": {
"resource": "PDOK CSW",
"probe_class": "GeoHealthCheck.plugins.probe.owsgetcaps.CswGetCaps",
"parameters": {
"service": "CSW",
"version": "2.0.2"
}
},
"PDOK CP WMTS - GetCaps": {
"resource": "PDOK CP WMTS",
"PDOK BRK WMTS - GetCaps": {
"resource": "PDOK BRK WMTS",
"probe_class": "GeoHealthCheck.plugins.probe.owsgetcaps.WmtsGetCaps",
"parameters": {
"service": "WMTS",
"version": "1.0.0"
}
},
"PDOK CP WMTS - GetTileREST": {
"resource": "PDOK CP WMTS",
"PDOK BRK WMTS - GetTileREST": {
"resource": "PDOK BRK WMTS",
"probe_class": "GeoHealthCheck.plugins.probe.wmts.WmtsGetTile",
"parameters": {
"layers": ["Kadastralekaart"],
Expand All @@ -223,8 +213,8 @@
"kvprest": "REST"
}
},
"PDOK CP WMTS - GetTileKVP": {
"resource": "PDOK CP WMTS",
"PDOK BRK WMTS - GetTileKVP": {
"resource": "PDOK BRK WMTS",
"probe_class": "GeoHealthCheck.plugins.probe.wmts.WmtsGetTile",
"parameters": {
"layers": ["Kadastralekaart"],
Expand All @@ -238,8 +228,8 @@
"kvprest": "KVP"
}
},
"PDOK BRT WMTS - GetTileAllKVP": {
"resource": "PDOK BRT WMTS",
"PDOK BRK WMTS - GetTileAllKVP": {
"resource": "PDOK BRK WMTS",
"probe_class": "GeoHealthCheck.plugins.probe.wmts.WmtsGetTileAll",
"parameters": {
"layers": ["All layers"],
Expand Down Expand Up @@ -310,8 +300,8 @@
"check_class": "GeoHealthCheck.plugins.check.checks.HttpHasImageContentType",
"parameters": {}
},
"WOUDC WFS - GetCaps - XML Parse": {
"probe_vars": "WOUDC WFS - GetCaps",
"RCE WFS - GetCaps - XML Parse": {
"probe_vars": "RCE WFS - GetCaps",
"check_class": "GeoHealthCheck.plugins.check.checks.XmlParse",
"parameters": {}
},
Expand Down Expand Up @@ -353,13 +343,13 @@
"strings": ["FeatureCollection"]
}
},
"WOUDC CSW - GetCaps - XML Parse": {
"probe_vars": "WOUDC CSW - GetCaps",
"PDOK CSW - GetCaps - XML Parse": {
"probe_vars": "PDOK CSW - GetCaps",
"check_class": "GeoHealthCheck.plugins.check.checks.XmlParse",
"parameters": {}
},
"PDOK CP WMTS - GetCaps - XML Parse": {
"probe_vars": "PDOK CP WMTS - GetCaps",
"PDOK BRK WMTS - GetCaps - XML Parse": {
"probe_vars": "PDOK BRK WMTS - GetCaps",
"check_class": "GeoHealthCheck.plugins.check.checks.XmlParse",
"parameters": {}
},
Expand All @@ -372,7 +362,7 @@
"probe_vars": "WOUDC LINK - PING",
"check_class": "GeoHealthCheck.plugins.check.checks.ContainsStrings",
"parameters": {
"strings": ["RDF>"]
"strings": ["Ozone"]
}
},
"OPENGEOGROEP TMS - HTTP - NoError": {
Expand All @@ -397,33 +387,33 @@
"check_class": "GeoHealthCheck.plugins.check.checks.HttpHasImageContentType",
"parameters": {}
},
"PDOK CP WMTS - GetTileREST - No Exception": {
"probe_vars": "PDOK CP WMTS - GetTileREST",
"PDOK BRK WMTS - GetTileREST - No Exception": {
"probe_vars": "PDOK BRK WMTS - GetTileREST",
"check_class": "GeoHealthCheck.plugins.check.checks.NotContainsOwsException",
"parameters": {"strings": ["ExceptionReport>", "ServiceException>"]}
},
"PDOK CP WMTS - GetTileREST - Content Type": {
"probe_vars": "PDOK CP WMTS - GetTileREST",
"PDOK BRK WMTS - GetTileREST - Content Type": {
"probe_vars": "PDOK BRK WMTS - GetTileREST",
"check_class": "GeoHealthCheck.plugins.check.checks.HttpHasImageContentType",
"parameters": {}
},
"PDOK CP WMTS - GetTileKVP - No Exception": {
"probe_vars": "PDOK CP WMTS - GetTileKVP",
"PDOK BRK WMTS - GetTileKVP - No Exception": {
"probe_vars": "PDOK BRK WMTS - GetTileKVP",
"check_class": "GeoHealthCheck.plugins.check.checks.NotContainsOwsException",
"parameters": {"strings": ["ExceptionReport>", "ServiceException>"]}
},
"PDOK CP WMTS - GetTileKVP - Content Type": {
"probe_vars": "PDOK CP WMTS - GetTileKVP",
"PDOK BRK WMTS - GetTileKVP - Content Type": {
"probe_vars": "PDOK BRK WMTS - GetTileKVP",
"check_class": "GeoHealthCheck.plugins.check.checks.HttpHasImageContentType",
"parameters": {}
},
"PDOK BRT WMTS - GetTileAllKVP - No Exception": {
"probe_vars": "PDOK BRT WMTS - GetTileAllKVP",
"PDOK BRK WMTS - GetTileAllKVP - No Exception": {
"probe_vars": "PDOK BRK WMTS - GetTileAllKVP",
"check_class": "GeoHealthCheck.plugins.check.checks.NotContainsOwsException",
"parameters": {"strings": ["ExceptionReport>", "ServiceException>"]}
},
"PDOK BRT WMTS - GetTileAllKVP - Content Type": {
"probe_vars": "PDOK BRT WMTS - GetTileAllKVP",
"PDOK BRK WMTS - GetTileAllKVP - Content Type": {
"probe_vars": "PDOK BRK WMTS - GetTileAllKVP",
"check_class": "GeoHealthCheck.plugins.check.checks.HttpHasImageContentType",
"parameters": {}
}
Expand Down
Loading
Loading