Skip to content

Commit 0d60ef1

Browse files
committed
fix: align analyzer fallback thresholds with official Vodafone spec and update report tests
1 parent 544e97a commit 0d60ef1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

app/analyzer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
_FALLBACK_THRESHOLDS = {
2121
"downstream_power": {
2222
"_default": "256QAM",
23-
"256QAM": {"good": [-3.9, 13.0], "warning": [-5.9, 18.0], "critical": [-8.0, 20.0]},
24-
"4096QAM": {"good": [-1.9, 15.0], "warning": [-3.9, 20.0], "critical": [-6.0, 22.0]},
23+
"256QAM": {"good": [-4.0, 13.0], "warning": [-6.0, 15.0], "critical": [-8.0, 16.0]},
24+
"4096QAM": {"good": [-2.0, 15.0], "warning": [-4.0, 16.0], "critical": [-6.0, 16.0]},
2525
},
2626
"upstream_power": {
2727
"_default": "sc_qam",
@@ -30,7 +30,7 @@
3030
},
3131
"snr": {
3232
"_default": "256QAM",
33-
"256QAM": {"good_min": 33.0, "warning_min": 31.0, "critical_min": 30.0},
33+
"256QAM": {"good_min": 33.0, "warning_min": 31.0, "critical_min": 29.0},
3434
"4096QAM": {"good_min": 40.0, "warning_min": 38.0, "critical_min": 36.0},
3535
},
3636
"upstream_modulation": {"critical_max_qam": 4, "warning_max_qam": 16},

tests/test_report.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_format_threshold_table_uses_real_values():
9090
# Check that values come from thresholds.json, not hardcoded
9191
ds_256 = [r for r in rows if r["category"] == "DS Power" and r["variant"] == "256QAM"]
9292
assert len(ds_256) == 1
93-
assert "-3.9" in ds_256[0]["good"]
93+
assert "-4.0" in ds_256[0]["good"]
9494
assert "13.0" in ds_256[0]["good"]
9595
# Upstream modulation thresholds
9696
us_mod = [r for r in rows if r["category"] == "US Modulation"]
@@ -104,9 +104,9 @@ def test_default_warn_thresholds():
104104
assert "ds_power" in warn
105105
assert "us_power" in warn
106106
assert "snr" in warn
107-
# 256QAM tolerated: -5.9 to 18.0
108-
assert "-5.9" in warn["ds_power"]
109-
assert "18.0" in warn["ds_power"]
107+
# 256QAM warning: -6.0 to 15.0
108+
assert "-6.0" in warn["ds_power"]
109+
assert "15.0" in warn["ds_power"]
110110
# EuroDOCSIS 3.0 tolerated: 37.1 to 51.0
111111
assert "37.1" in warn["us_power"]
112112
assert "51.0" in warn["us_power"]
@@ -140,7 +140,7 @@ def test_generate_report_with_none_channel_values():
140140
def test_complaint_text_uses_real_thresholds():
141141
text = generate_complaint_text(MOCK_SNAPSHOTS)
142142
# Should contain real threshold values from thresholds.json
143-
assert "-5.9 to 18.0 dBmV" in text
143+
assert "-6.0 to 15.0 dBmV" in text
144144
assert "37.1 to 51.0 dBmV" in text
145145
assert ">= 31.0 dB" in text
146146

0 commit comments

Comments
 (0)