feat: report facts, not warnings (0.2.0)
CI / test (3.10) (push) Successful in 5m27s
CI / test (3.11) (push) Successful in 5m24s
CI / test (3.12) (push) Successful in 5m23s
CI / test (3.10) (pull_request) Successful in 5m26s
CI / test (3.11) (pull_request) Successful in 5m18s
CI / test (3.12) (pull_request) Successful in 5m21s
CI / test (3.10) (push) Successful in 5m27s
CI / test (3.11) (push) Successful in 5m24s
CI / test (3.12) (push) Successful in 5m23s
CI / test (3.10) (pull_request) Successful in 5m26s
CI / test (3.11) (pull_request) Successful in 5m18s
CI / test (3.12) (pull_request) Successful in 5m21s
Drop get_device_warnings. The DSL noise margin and the firmware on offer are already facts in get_system_config (dsl_downstream_noise_margin, firmware_update_available, firmware_version); netOrk derives dsl_snr_low and firmware_update_available from them (netOrk #1111).
This commit is contained in:
1 parent
c6a51f730f
commit
ec3e1e9028
3 files changed
+6
-62
No files matched your search
@@ -647,37 +647,14 @@ class TestAutoMaxBitRate:
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# get_device_warnings
|
||||
# warnings
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class TestGetDeviceWarnings:
|
||||
def test_returns_empty_list(self, driver):
|
||||
# UI_INFO has UpdateState=Available → one warning expected
|
||||
warnings = driver.get_device_warnings()
|
||||
codes = [w["code"] for w in warnings]
|
||||
assert "firmware_update_available" in codes
|
||||
|
||||
def test_no_firmware_warning_when_no_update(self, driver):
|
||||
driver.fc.call_action.side_effect = lambda svc, act, **kw: (
|
||||
UI_INFO_NO_UPDATE if (svc, act) == ("UserInterface1", "X_AVM-DE_GetInfo")
|
||||
else _call_action(svc, act, **kw)
|
||||
)
|
||||
warnings = driver.get_device_warnings()
|
||||
assert not any(w["code"] == "firmware_update_available" for w in warnings)
|
||||
|
||||
def test_dsl_snr_low_warning(self, driver):
|
||||
low_snr = dict(DSL_INFO, NewDownstreamNoiseMargin=40) # 4.0 dB < 6 dB threshold
|
||||
driver.fc.call_action.side_effect = lambda svc, act, **kw: (
|
||||
low_snr if (svc, act) == ("WANDSLInterfaceConfig1", "GetInfo")
|
||||
else _call_action(svc, act, **kw)
|
||||
)
|
||||
warnings = driver.get_device_warnings()
|
||||
assert any(w["code"] == "dsl_snr_low" for w in warnings)
|
||||
|
||||
def test_no_dsl_warning_when_snr_ok(self, driver):
|
||||
warnings = driver.get_device_warnings()
|
||||
assert not any(w["code"] == "dsl_snr_low" for w in warnings)
|
||||
def test_no_warnings_of_its_own():
|
||||
"""The DSL margin and the firmware on offer are facts in get_system_config; the
|
||||
application decides they are warnings (netOrk #1111)."""
|
||||
assert "get_device_warnings" not in vars(FritzBoxDriver)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user