X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1fd483643b3619ef5409206292efb2563bda230e..c4f22a42eba499ed1854c5967b2e3932fe9b3896:/test/bdd/steps/http_responses.py?ds=inline diff --git a/test/bdd/steps/http_responses.py b/test/bdd/steps/http_responses.py index 247a397b..fa6ab7fb 100644 --- a/test/bdd/steps/http_responses.py +++ b/test/bdd/steps/http_responses.py @@ -1,3 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# This file is part of Nominatim. (https://nominatim.org) +# +# Copyright (C) 2022 by the Nominatim developer community. +# For a full list of authors see the git log. """ Classes wrapping HTTP responses from the Nominatim API. """ @@ -8,7 +14,9 @@ import xml.etree.ElementTree as ET from check_functions import Almost -OSM_TYPE = {'N' : 'node', 'W' : 'way', 'R' : 'relation'} +OSM_TYPE = {'N' : 'node', 'W' : 'way', 'R' : 'relation', + 'n' : 'node', 'w' : 'way', 'r' : 'relation', + 'node' : 'n', 'way' : 'w', 'relation' : 'r'} def _geojson_result_to_json_result(geojson_result): result = geojson_result['properties'] @@ -139,6 +147,9 @@ class GenericResponse: assert self.result[i]['osm_type'] in (OSM_TYPE[value[0]], value[0]), \ BadRowValueAssert(self, i, 'osm_type', value) self.assert_field(i, 'osm_id', value[1:]) + elif name == 'osm_type': + assert self.result[i]['osm_type'] in (OSM_TYPE[value[0]], value[0]), \ + BadRowValueAssert(self, i, 'osm_type', value) elif name == 'centroid': lon, lat = value.split(' ') self.assert_field(i, 'lat', float(lat))