mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
bdd: run full import on tests
This uncovered a couple of outdated/wrong tests which have been fixed, too.
This commit is contained in:
@@ -62,11 +62,14 @@ class NominatimID:
|
||||
','.join(['*'] + (extra_columns or [])), table)
|
||||
cur.execute(query, (pid, ))
|
||||
|
||||
def get_place_id(self, cur):
|
||||
def get_place_id(self, cur, allow_empty=False):
|
||||
""" Look up the place id for the ID. Throws an assertion if the ID
|
||||
is not unique.
|
||||
"""
|
||||
self.query_osm_id(cur, "SELECT place_id FROM placex WHERE {}")
|
||||
if cur.rowcount == 0 and allow_empty:
|
||||
return None
|
||||
|
||||
assert cur.rowcount == 1, \
|
||||
"Place ID {!s} not unique. Found {} entries.".format(self, cur.rowcount)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user