Skip to content

Commit a1b859e

Browse files
author
Henry Walshaw
committed
Add recipient to the general fixtures
Also update the external links to be https (as otherwise we have to wait for a bunch of redirects in the tests as well).
1 parent 9d25066 commit a1b859e

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

GeoHealthCheck/models.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,18 @@ def load_data(file_path):
911911
checks[check_name] = check
912912
DB.session.add(check)
913913

914+
# add Recipient, keeping track of DB objects
915+
recipients = {}
916+
for recipient_name in objects.get('recipients', {}):
917+
recipient = objects['recipients'][recipient_name]
918+
919+
recipient = Recipient(recipient['channel'], recipient['location'])
920+
for resource_name in objects['recipients'][recipient_name]['resources']:
921+
recipient.resources.append(resources[resource_name])
922+
923+
recipients[recipient_name] = recipient
924+
DB.session.add(recipient)
925+
914926
db_commit()
915927

916928

tests/data/fixtures.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"resource_type": "OGC:WFS",
3232
"active": true,
3333
"title": "WOUDC Web Feature Service",
34-
"url": "http://geo.woudc.org/ows",
34+
"url": "https://geo.woudc.org/ows",
3535
"tags": [
3636
"ows"
3737
]
@@ -52,7 +52,7 @@
5252
"resource_type": "OGC:CSW",
5353
"active": true,
5454
"title": "WOUDC Catalogue Service",
55-
"url": "http://geo.woudc.org/csw",
55+
"url": "https://geo.woudc.org/csw",
5656
"tags": [
5757
"ows"
5858
]
@@ -85,7 +85,7 @@
8585
"resource_type": "WWW:LINK",
8686
"active": true,
8787
"title": "WOUDC Definitions Service",
88-
"url": "http://geo.woudc.org/def",
88+
"url": "https://geo.woudc.org/def",
8989
"tags": []
9090
},
9191
"OPENGEOGROEP TMS": {
@@ -176,7 +176,7 @@
176176
"parameters": {
177177
"type_name": "bag:verblijfsobject",
178178
"type_ns_prefix": "bag",
179-
"type_ns_uri": "http://bag.geonovum.nl",
179+
"type_ns_uri": "https://bag.geonovum.nl",
180180
"srs": "EPSG:28992",
181181
"bbox": ["180635", "455870", "180961", "456050"]
182182
}
@@ -187,7 +187,7 @@
187187
"parameters": {
188188
"type_name": "all 5 featuretypes",
189189
"type_ns_prefix": "bag",
190-
"type_ns_uri": "http://bag.geonovum.nl",
190+
"type_ns_uri": "https://bag.geonovum.nl",
191191
"srs": "EPSG:28992",
192192
"bbox": ["180635", "455870", "180961", "456050"]
193193
}
@@ -427,5 +427,14 @@
427427
"check_class": "GeoHealthCheck.plugins.check.checks.HttpHasImageContentType",
428428
"parameters": {}
429429
}
430+
},
431+
"recipients": {
432+
"PDOK BAG WMS": {
433+
"channel": "webhook",
434+
"location": "https://localhost/webhook",
435+
"resources": [
436+
"PDOK BAG WMS"
437+
]
438+
}
430439
}
431440
}

0 commit comments

Comments
 (0)