feat: add node coverage and improve investigation presentation
This commit is contained in:
@@ -1,4 +1,18 @@
|
||||
from app.native.wndb.gis import network_views, region_geometry
|
||||
|
||||
|
||||
def test_selected_node_positions_use_bound_project_and_parameterized_geometry_query(monkeypatch):
|
||||
calls = []
|
||||
|
||||
def read_all(network, statement, parameters):
|
||||
calls.append((network, statement, parameters))
|
||||
return [{"id": "A", "longitude": 117.24, "latitude": 32.75}]
|
||||
|
||||
monkeypatch.setattr(network_views, "read_all", read_all)
|
||||
assert network_views.get_node_geographic_positions("project-a", []) == []
|
||||
assert network_views.get_node_geographic_positions("project-a", ["A"])[0]["id"] == "A"
|
||||
assert len(calls) == 1 and calls[0][0] == "project-a" and calls[0][2] == (["A"],)
|
||||
assert "ST_Transform(geom,4326)" in calls[0][1] and "node_id = ANY(%s)" in calls[0][1]
|
||||
from app.native.wndb.model import elements
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user