fix(sensor): use published coordinates for custom SRIDs
Generic Container CI/CD / test-build-publish (push) Successful in 2m11s
Server CI/CD v2 / build-test-publish-and-deploy (push) Successful in 2m11s

Result validation bypassed the project-specific GIS transform and called ST_Transform on custom engineering SRIDs. Read project and map coordinates from gis.junctions so every project uses its configured publication transform.
This commit is contained in:
2026-09-11 11:29:51 +08:00
parent 90b02057bc
commit 0685f6dd17
2 changed files with 16 additions and 14 deletions
+6 -3
View File
@@ -122,7 +122,7 @@ def test_list_sensor_placements_batches_node_lookup(monkeypatch):
assert [len(run["sensor_points"]) for run in runs] == [2, 2]
def test_sensor_nodes_query_uses_new_network_and_gis_schemas(monkeypatch):
def test_sensor_nodes_query_uses_published_junction_coordinates(monkeypatch):
cursor = _mock_project_cursor(monkeypatch)
cursor.fetchall.return_value = []
@@ -131,8 +131,11 @@ def test_sensor_nodes_query_uses_new_network_and_gis_schemas(monkeypatch):
query = cursor.execute.call_args.args[0]
assert "network.pipes" in query
assert "network.links" in query
assert "gis.node_geometries" in query
assert "ST_Transform(g.geom, 3857)" in query
assert "FROM gis.junctions AS g" in query
assert "g.x AS project_x" in query
assert "ST_X(g.geom) AS map_x" in query
assert "gis.node_geometries" not in query
assert "ST_Transform" not in query
assert "l.start_node_id = ANY(%s)" in query
assert "l.end_node_id = ANY(%s)" in query
assert "CROSS JOIN LATERAL" not in query