X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/eb1d8894b943eb0f07747d1dab203217860b6930..64883cc917c312908c3c04c6d1ed423181d26c8a:/tests/steps/api_result.py diff --git a/tests/steps/api_result.py b/tests/steps/api_result.py index 369127d8..17d5e4eb 100644 --- a/tests/steps/api_result.py +++ b/tests/steps/api_result.py @@ -27,7 +27,7 @@ def _parse_xml(): world.results = [] # results - if page.nodeName == 'searchresults': + if page.nodeName == 'searchresults' or page.nodeName == 'lookupresults': for node in page.childNodes: if node.nodeName != "#text": assert_equals(node.nodeName, 'place', msg="Unexpected element '%s'" % node.nodeName) @@ -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):