Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pathmapper authored and nyalldawson committed Nov 14, 2022
1 parent 22db26d commit fc3cb14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/src/python/test_qgsnominatimgeocoder.py
Expand Up @@ -78,6 +78,9 @@ def test_url(self):
self.assertEqual(geocoder.requestUrl('20 green st, twaddlingham', QgsRectangle(3, 5, 6, 8)).toString(),
'https://nominatim.qgis.org/search?format=json&addressdetails=1&viewbox=3,5,6,8&q=20 green st, twaddlingham')

self.assertEqual(geocoder.requestUrl('20 green st, twaddlingham', QgsRectangle(float('-inf'), float('-inf'), float('inf'), float('inf'))).toString(),
'https://nominatim.qgis.org/search?format=json&addressdetails=1&q=20 green st, twaddlingham')

geocoder = QgsNominatimGeocoder(countryCodes='ca,km', endpoint='https://my.server/search')
self.assertEqual(geocoder.requestUrl('20 green st, twaddlingham', QgsRectangle(3, 5, 6, 8)).toString(),
'https://my.server/search?format=json&addressdetails=1&viewbox=3,5,6,8&countrycodes=ca,km&q=20 green st, twaddlingham')
Expand Down

0 comments on commit fc3cb14

Please sign in to comment.