From f0a833ccc80a696cc4c34c02644a5ec5728ff383 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Mon, 28 Sep 2026 07:44:29 +1000 Subject: [PATCH] BE: docstrings --- server/scan/device_handling.py | 5 +++++ test/scan/test_scan_stats_mac_case.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/server/scan/device_handling.py b/server/scan/device_handling.py index 0fe86bd39..14aa4eb3f 100755 --- a/server/scan/device_handling.py +++ b/server/scan/device_handling.py @@ -572,6 +572,11 @@ def save_own_device(db): # ------------------------------------------------------------------------------- def print_scan_stats(db): + """ + Log diagnostic scan-cycle counts (devices detected, new devices, down + alerts, new connections, disconnections, IP changes, per-plugin scan + method counts) at verbose/trace log levels. No return value. + """ sql = db.sql # TO-DO query = f""" diff --git a/test/scan/test_scan_stats_mac_case.py b/test/scan/test_scan_stats_mac_case.py index a55280195..6ca2afb82 100644 --- a/test/scan/test_scan_stats_mac_case.py +++ b/test/scan/test_scan_stats_mac_case.py @@ -44,6 +44,8 @@ def _run_stats(conn, monkeypatch): logged = {} def fake_mylog(level, parts): + """Stand in for logger.mylog: parse the down_alerts/new_down_alerts + counts straight out of print_scan_stats()'s own log lines.""" text = "".join(parts) if isinstance(parts, list) else str(parts) if "Down Alerts" in text and "New Down Alerts" not in text: logged["down_alerts"] = int(text.rsplit(":", 1)[1].strip())