added land

This commit is contained in:
2026-06-23 13:14:27 +03:00
parent 11a172ef3d
commit cfbfcb52d3
15 changed files with 106 additions and 4 deletions
+25
View File
@@ -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