Spaces:
Build error
Build error
File size: 917 Bytes
3816b9b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# tests/test_validators.py — minimal unit tests for validator logic
import numpy as np
# Synthetic totals for monotonicity
worst_ebitda = 100
base_ebitda = 150
best_ebitda = 200
worst_cash = 80
base_cash = 120
best_cash = 160
assert worst_ebitda <= base_ebitda <= best_ebitda, "EBITDA monotonicity failed"
assert worst_cash <= base_cash <= best_cash, "Cash monotonicity failed"
# Bounds example
bounds = {
"rev_growth_pct": (-0.20, 0.30),
"gm_bps": (-500, 500),
"opex_infl_pct": (-0.10, 0.20),
"fx_pct": (-0.10, 0.10),
"dso": (30, 90),
"dpo": (15, 90),
"dio": (20, 120),
}
sample_drivers = {"rev_growth_pct": 0.05, "gm_bps": 100, "opex_infl_pct": 0.02, "fx_pct": 0.00, "dso": 60, "dpo": 45, "dio": 60}
for k,(lo,hi) in bounds.items():
v = sample_drivers[k]
assert lo <= v <= hi, f"{k} out of bounds"
print("Validator smoke tests passed.")
|