Skip to content
Permalink
Browse files
Test for regression #43905 OAPIF extra query params
  • Loading branch information
Joonalai authored and github-actions committed Jul 1, 2021
1 parent fa1a59f commit 261cae09a5337e9da530fa3015ed0b3f47bc22f1
Showing with 9 additions and 1 deletion.
  1. +9 −1 tests/src/python/test_provider_oapif.py
@@ -20,6 +20,7 @@

from osgeo import gdal
from qgis.PyQt.QtCore import QCoreApplication, Qt, QObject, QDateTime, QVariant
from qgis.PyQt.QtTest import QSignalSpy

from qgis.core import (
QgsWkbTypes,
@@ -36,7 +37,8 @@
QgsExpressionContextUtils,
QgsExpressionContext,
QgsCoordinateReferenceSystem,
QgsBox3d
QgsBox3d,
QgsMessageLog
)
from qgis.testing import (start_app,
unittest
@@ -702,10 +704,16 @@ def testApikey(self):
with open(sanitize(endpoint, '/collections/mycollection/items?limit=1000&apikey=mykey&' + ACCEPT_ITEMS), 'wb') as f:
f.write(json.dumps(first_items).encode('UTF-8'))

app_log = QgsApplication.messageLog()

# signals should be emitted by application log
app_spy = QSignalSpy(app_log.messageReceived)

vl = QgsVectorLayer("url='http://" + endpoint + "?apikey=mykey' typename='mycollection'", 'test', 'OAPIF')
self.assertTrue(vl.isValid())
values = [f['id'] for f in vl.getFeatures()]
self.assertEqual(values, ['feat.1'])
self.assertEqual(len(app_spy), 0, list(app_spy))


if __name__ == '__main__':

0 comments on commit 261cae0

Please sign in to comment.