fin-hub/tests/test_runway.py
tegwick 1abbbe85e4 Implement fin-hub T24-T26: ingest, runway, coupling, RaaS packaging
Add CSV importers, runway calculator, budget alerts, cross-hub coupling
emitters, finhub CLI, and raas-mvp-packaging docs with full test coverage.
2026-07-08 00:59:39 +02:00

16 lines
No EOL
700 B
Python

from fin_hub.services.alerts import evaluate_budget_alerts
from fin_hub.services.runway import compute_runway
def test_compute_runway_below_threshold():
runway = compute_runway(current_balance=6000, monthly_burns=[2000, 2200, 2100], alert_threshold_months=3.0)
assert runway.months_remaining < 3.0
assert runway.below_threshold is True
def test_budget_alerts_include_runway_and_utilisation():
runway = compute_runway(current_balance=6000, monthly_burns=[2000, 2200, 2100])
alerts = evaluate_budget_alerts(runway=runway, allocated=10000, spent=8500)
codes = {alert.code for alert in alerts}
assert "runway_below_threshold" in codes
assert "budget_pressure" in codes