added conopy
This commit is contained in:
@@ -17,6 +17,7 @@ def test_openapi_contains_expected_paths() -> None:
|
||||
paths = response.json()["paths"]
|
||||
assert "/api/v1/terrain/profile" in paths
|
||||
assert "/api/v1/terrain/los" in paths
|
||||
assert "/api/v1/terrain/fresnel-slice" in paths
|
||||
assert "/api/v1/link/budget" in paths
|
||||
assert "/api/v1/coverage" in paths
|
||||
assert "/api/v1/status/data" in paths
|
||||
@@ -100,6 +101,28 @@ def test_los_endpoint_returns_obstruction_summary_fields() -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_fresnel_slice_endpoint_returns_geojson() -> None:
|
||||
response = client.post(
|
||||
"/api/v1/terrain/fresnel-slice",
|
||||
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_fraction": 0.6,
|
||||
"include_buildings": False,
|
||||
"include_canopy": False,
|
||||
"samples": 16,
|
||||
},
|
||||
)
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["path_geojson"]["type"] == "LineString"
|
||||
assert data["fresnel_geojson"]["type"] == "Feature"
|
||||
assert data["fresnel_geojson"]["geometry"]["type"] in {"Polygon", "MultiPolygon"}
|
||||
assert data["buildings_geojson"]["type"] == "FeatureCollection"
|
||||
assert len(data["profile"]) == 16
|
||||
|
||||
|
||||
def test_manual_link_budget_endpoint() -> None:
|
||||
response = client.post(
|
||||
"/api/v1/link/budget",
|
||||
|
||||
Reference in New Issue
Block a user