X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c314a3092c5b51c7782015f6fa9ac093b46fa174..5160a1d57758ca95bb22d8372f6e84fb8f58e191:/test/python/api/search/test_search_postcode.py diff --git a/test/python/api/search/test_search_postcode.py b/test/python/api/search/test_search_postcode.py index 633e07bc..369e1504 100644 --- a/test/python/api/search/test_search_postcode.py +++ b/test/python/api/search/test_search_postcode.py @@ -59,6 +59,19 @@ def test_postcode_with_country(apiobj, frontend): assert results[0].place_id == 101 +def test_postcode_area(apiobj, frontend): + apiobj.add_postcode(place_id=100, country_code='ch', postcode='12345') + apiobj.add_placex(place_id=200, country_code='ch', postcode='12345', + osm_type='R', osm_id=34, class_='boundary', type='postal_code', + geometry='POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))') + + results = run_search(apiobj, frontend, 0.3, ['12345'], [0.0]) + + assert len(results) == 1 + assert results[0].place_id == 200 + assert results[0].bbox.area == 1 + + class TestPostcodeSearchWithAddress: @pytest.fixture(autouse=True)