X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/bd2c64876f7ddc99da14ea78a652f797e17134f4..e523da9e12ad87b945a7b5add83618258ccf1efb:/test/python/api/search/test_db_search_builder.py diff --git a/test/python/api/search/test_db_search_builder.py b/test/python/api/search/test_db_search_builder.py index 9631850e..63589ffc 100644 --- a/test/python/api/search/test_db_search_builder.py +++ b/test/python/api/search/test_db_search_builder.py @@ -382,7 +382,7 @@ def test_frequent_partials_in_name_but_not_in_address(): def test_frequent_partials_in_name_and_address(): - searches = make_counted_searches(10000, 1, 10000, 1) + searches = make_counted_searches(9999, 1, 9999, 1) assert len(searches) == 2 @@ -393,3 +393,15 @@ def test_frequent_partials_in_name_and_address(): {('name_vector', 'lookup_any'), ('nameaddress_vector', 'restrict')} assert set((l.column, l.lookup_type) for l in searches[1].lookups) == \ {('nameaddress_vector', 'lookup_all'), ('name_vector', 'lookup_all')} + + +def test_too_frequent_partials_in_name_and_address(): + searches = make_counted_searches(10000, 1, 10000, 1) + + assert len(searches) == 1 + + assert all(isinstance(s, dbs.PlaceSearch) for s in searches) + searches.sort(key=lambda s: s.penalty) + + assert set((l.column, l.lookup_type) for l in searches[0].lookups) == \ + {('name_vector', 'lookup_any'), ('nameaddress_vector', 'restrict')}