bdd: move import tests from scenes to grid descriptions

This commit is contained in:
Sarah Hoffmann
2022-06-15 22:22:13 +02:00
parent 3493d317e4
commit 02068aec7f
10 changed files with 829 additions and 568 deletions

View File

@@ -69,7 +69,7 @@ def define_node_grid(context, grid_step, origin):
coords = origin.split(',')
if len(coords) != 2:
raise RuntimeError('Grid origin expects orgin with x,y coordinates.')
origin(float(coords[0]), float(coords[1]))
origin = (float(coords[0]), float(coords[1]))
elif origin in ALIASES:
origin = ALIASES[origin]
else:

View File

@@ -157,7 +157,11 @@ 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):