added vegetation
This commit is contained in:
@@ -19,6 +19,7 @@ def test_openapi_contains_expected_paths() -> None:
|
||||
assert "/api/v1/terrain/los" in paths
|
||||
assert "/api/v1/link/budget" in paths
|
||||
assert "/api/v1/coverage" in paths
|
||||
assert "/api/v1/status/data" in paths
|
||||
|
||||
|
||||
def test_profile_endpoint_returns_geodesic_samples() -> None:
|
||||
@@ -38,11 +39,26 @@ def test_profile_endpoint_returns_geodesic_samples() -> None:
|
||||
assert data["distance_m"] > 0
|
||||
assert len(data["samples"]) == 4
|
||||
assert data["path_geojson"]["type"] == "LineString"
|
||||
assert "data_sources" in data
|
||||
|
||||
|
||||
def test_elevation_returns_not_implemented_without_dem() -> None:
|
||||
response = client.get("/api/v1/terrain/elevation", params={"lat": 60.17, "lon": 24.94})
|
||||
assert response.status_code == 501
|
||||
assert response.json()["detail"]["code"] == "DEM_NOT_CONFIGURED"
|
||||
|
||||
|
||||
def test_profile_rejects_too_many_samples() -> None:
|
||||
response = client.post(
|
||||
"/api/v1/terrain/profile",
|
||||
json={
|
||||
"start": {"lat": 60.17, "lon": 24.94},
|
||||
"end": {"lat": 60.25, "lon": 25.10},
|
||||
"samples": 2049,
|
||||
},
|
||||
)
|
||||
assert response.status_code == 422
|
||||
assert response.json()["detail"]["code"] == "VALIDATION_ERROR"
|
||||
|
||||
|
||||
def test_los_endpoint_returns_obstruction_summary_fields() -> None:
|
||||
@@ -66,6 +82,7 @@ def test_los_endpoint_returns_obstruction_summary_fields() -> None:
|
||||
assert data["fresnel_violations_count"] == len(data["obstructions"])
|
||||
assert data["geometric_obstructions_count"] == len(data["geometric_obstructions"])
|
||||
assert "vegetation_loss_db" in data
|
||||
assert "data_sources" in data
|
||||
assert data["building_obstructions_count"] == len(
|
||||
[item for item in data["geometric_obstructions"] if item["type"] == "building"]
|
||||
)
|
||||
@@ -94,3 +111,4 @@ def test_manual_link_budget_endpoint() -> None:
|
||||
data = response.json()
|
||||
assert data["fspl_db"] > 0
|
||||
assert "link_viable" in data
|
||||
assert "data_sources" in data
|
||||
|
||||
Reference in New Issue
Block a user