added land
This commit is contained in:
Binary file not shown.
@@ -65,6 +65,7 @@ def test_los_endpoint_returns_obstruction_summary_fields() -> None:
|
||||
assert "geometric_obstructions" in data
|
||||
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["building_obstructions_count"] == len(
|
||||
[item for item in data["geometric_obstructions"] if item["type"] == "building"]
|
||||
)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
from app.models.coverage import LinkRx, LinkTx
|
||||
from app.models.link import LinkBudgetRequest
|
||||
from app.services import link as link_service
|
||||
|
||||
|
||||
def test_link_budget_includes_vegetation_loss(monkeypatch) -> None:
|
||||
monkeypatch.setattr(link_service, "vegetation_loss_along", lambda *args, **kwargs: 5.0)
|
||||
request = LinkBudgetRequest(
|
||||
tx=LinkTx(lat=60.17, lon=24.94, height_agl=30, power_dbm=37, gain_dbi=8),
|
||||
rx=LinkRx(
|
||||
lat=60.25,
|
||||
lon=25.10,
|
||||
height_agl=2,
|
||||
gain_dbi=2,
|
||||
sensitivity_dbm=-110,
|
||||
),
|
||||
frequency_mhz=433,
|
||||
model="manual",
|
||||
include_vegetation=True,
|
||||
)
|
||||
|
||||
result = link_service.link_budget(request)
|
||||
|
||||
assert result.vegetation_db == 5.0
|
||||
assert result.total_loss_db == result.fspl_db + 5.0
|
||||
Reference in New Issue
Block a user