X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9bdbbec0c8141bdcb22fb562b4e1235dadcc446c..7b44cb9577ca6b9fb6c82be86a343730cf4ed5b8:/test/bdd/steps/db_ops.py diff --git a/test/bdd/steps/db_ops.py b/test/bdd/steps/db_ops.py index a0924840..b50f1d59 100644 --- a/test/bdd/steps/db_ops.py +++ b/test/bdd/steps/db_ops.py @@ -498,6 +498,21 @@ def check_place_addressline(context): context.db.commit() +@then("place_addressline doesn't contain") +def check_place_addressline_exclude(context): + cur = context.db.cursor(cursor_factory=psycopg2.extras.DictCursor) + + for row in context.table: + pid = NominatimID(row['object']).get_place_id(cur) + apid = NominatimID(row['address']).get_place_id(cur) + cur.execute(""" SELECT * FROM place_addressline + WHERE place_id = %s AND address_place_id = %s""", + (pid, apid)) + eq_(0, cur.rowcount, + "Row found for place %s and address %s" % (row['object'], row['address'])) + + context.db.commit() + @then("(?P\w+) expands to(?P no)? interpolation") def check_location_property_osmline(context, oid, neg): cur = context.db.cursor(cursor_factory=psycopg2.extras.DictCursor)