X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/f74228830d4e757ad59da125b020c08461a61a3e..93203f355a9791f74d1c15b9ffcb1afdc848f6a0:/test/bdd/steps/table_compare.py?ds=sidebyside diff --git a/test/bdd/steps/table_compare.py b/test/bdd/steps/table_compare.py index ca6c3020..cf2e12f1 100644 --- a/test/bdd/steps/table_compare.py +++ b/test/bdd/steps/table_compare.py @@ -157,11 +157,15 @@ class DBRow: ST_SetSRID('{geomtxt}'::geometry, 4326))""".format(**self.db_row)) return cur.fetchone()[0] - x, y = expected.split(' ') + if ' ' in expected: + x, y = expected.split(' ') + else: + x, y = self.context.osm.grid_node(int(expected)) + return Almost(float(x)) == self.db_row['cx'] and Almost(float(y)) == self.db_row['cy'] def _has_geometry(self, expected): - geom = self.context.osm.parse_geometry(expected, self.context.scene) + geom = self.context.osm.parse_geometry(expected) with self.context.db.cursor() as cur: cur.execute("""SELECT ST_Equals(ST_SnapToGrid({}, 0.00001, 0.00001), ST_SnapToGrid(ST_SetSRID('{}'::geometry, 4326), 0.00001, 0.00001))""".format(