fix: update tests to match current algorithm — thresholds, _best_climb tuples, ComputedMetrics fields
CI / Python tests (push) Waiting to run
CI / Frontend build (push) Waiting to run

This commit is contained in:
Davide Scaini
2026-06-03 22:18:17 +02:00
parent f167c6eed7
commit 060bdf5114
4 changed files with 36 additions and 29 deletions
+3 -3
View File
@@ -154,10 +154,10 @@ def test_hysteresis_recalc_barometric(tmp_path):
result = recalculate_elevation_hysteresis(tmp_path, "test-act")
assert result["altitude_source"] == "barometric"
assert result["threshold_m"] == pytest.approx(1.0)
assert result["threshold_m"] == pytest.approx(1.5)
# Edge effect is ≤1% on a 30-min ramp
assert result["elevation_gain_m"] == pytest.approx(1800.0, rel=0.02)
assert result["elevation_loss_m"] == pytest.approx(0.0, abs=1.0)
assert result["elevation_loss_m"] == pytest.approx(0.0, abs=1.5)
def test_hysteresis_recalc_gps(tmp_path):
@@ -166,7 +166,7 @@ def test_hysteresis_recalc_gps(tmp_path):
result = recalculate_elevation_hysteresis(tmp_path, "test-act")
assert result["threshold_m"] == pytest.approx(3.0)
assert result["threshold_m"] == pytest.approx(2.0)
assert result["elevation_gain_m"] == pytest.approx(1800.0, rel=0.02)