added obstacles

This commit is contained in:
2026-06-23 11:49:32 +03:00
parent 69b810450e
commit 6be9810404
6 changed files with 48 additions and 2 deletions
+25
View File
@@ -45,6 +45,31 @@ def test_elevation_returns_not_implemented_without_dem() -> None:
assert response.status_code == 501
def test_los_endpoint_returns_obstruction_summary_fields() -> None:
response = client.post(
"/api/v1/terrain/los",
json={
"tx": {"lat": 59.935, "lon": 30.305, "height_agl": 30},
"rx": {"lat": 59.945, "lon": 30.325, "height_agl": 2},
"frequency_mhz": 433,
"fresnel_clearance": 0.6,
"include_buildings": False,
"include_canopy": False,
"k_factor": 1.333,
"samples": 16,
},
)
assert response.status_code == 200
data = response.json()
assert "obstructions" in data
assert "geometric_obstructions" in data
assert data["fresnel_violations_count"] == len(data["obstructions"])
assert data["geometric_obstructions_count"] == len(data["geometric_obstructions"])
assert data["building_obstructions_count"] == len(
[item for item in data["geometric_obstructions"] if item["type"] == "building"]
)
def test_manual_link_budget_endpoint() -> None:
response = client.post(
"/api/v1/link/budget",