X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1b44fe2555d17618cb2e7556de5d23ddad01d5f5..cd64788a583f7737ff7cddaa4f21e74ea747bef9:/test/bdd/steps/table_compare.py diff --git a/test/bdd/steps/table_compare.py b/test/bdd/steps/table_compare.py index 4284fad9..f0d27ba5 100644 --- a/test/bdd/steps/table_compare.py +++ b/test/bdd/steps/table_compare.py @@ -7,14 +7,13 @@ """ Functions to facilitate accessing and comparing the content of DB tables. """ +import math import re import json import psycopg from psycopg import sql as pysql -from steps.check_functions import Almost - ID_REGEX = re.compile(r"(?P[NRW])(?P\d+)(:(?P\w+))?") class NominatimID: @@ -166,7 +165,7 @@ class DBRow: 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'] + return math.isclose(float(x), self.db_row['cx']) and math.isclose(float(y), self.db_row['cy']) def _has_geometry(self, expected): geom = self.context.osm.parse_geometry(expected)