From: Sarah Hoffmann Date: Fri, 22 May 2015 19:49:31 +0000 (+0200) Subject: update API tests X-Git-Tag: v.2.5.0~46 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/b4f9252c63926817444d69dd8a4a32b6267db305 update API tests --- diff --git a/tests/features/api/search.feature b/tests/features/api/search.feature index 859faa76..c7ce7d3b 100644 --- a/tests/features/api/search.feature +++ b/tests/features/api/search.feature @@ -36,7 +36,7 @@ Feature: Search queries Then address of result 0 contains | type | value | house_number | 140 - | road | rue Don Bosco + | road | [Rr]ue Don Bosco | city | Saguenay | state | Quebec | country | Canada @@ -50,7 +50,7 @@ Feature: Search queries Then address of result 0 contains | type | value | house_number | 141 - | road | rue Don Bosco + | road | [rR]ue Don Bosco | city | Saguenay | state | Quebec | country | Canada diff --git a/tests/features/api/search_params.feature b/tests/features/api/search_params.feature index 1062cd02..b9d06791 100644 --- a/tests/features/api/search_params.feature +++ b/tests/features/api/search_params.feature @@ -83,7 +83,7 @@ Feature: Search queries Scenario: bounded search remains within viewbox, even with no results Given the request parameters | bounded | viewbox - | 1 | -5.662003,43.54285,-5.6563282,43.5403125 + | 1 | 43.54285,-5.662003,43.5403125,-5.6563282 When sending json search query "restaurant" Then less than 1 result is returned diff --git a/tests/steps/api_result.py b/tests/steps/api_result.py index 369127d8..e86641fc 100644 --- a/tests/steps/api_result.py +++ b/tests/steps/api_result.py @@ -199,7 +199,10 @@ def api_result_address_exact(step, resid): addr = world.results[resid]['address'] for line in step.hashes: assert_in(line['type'], addr) - assert_equals(line['value'], addr[line['type']]) + m = re.match("%s$" % line['value'], addr[line['type']]) + assert_is_not_none(m, msg="field %s does not match: %s$ != %s." % ( + line['type'], line['value'], addr[line['type']])) + #assert_equals(line['value'], addr[line['type']]) @step(u'address of result (\d+) does not contain (.*)') def api_result_address_details_missing(step, resid, types):