X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/713ea080d2cf6b5a5e412b63111f81336fa2f7f0..e5b74245922339f0bf9c0c36a67a261a13af3fa1:/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)