From c263e939fd9848508a68ae974c7eaf3f5404cb0f Mon Sep 17 00:00:00 2001 From: Mauricio Camayo Date: Thu, 22 Oct 2026 12:29:12 -0500 Subject: [PATCH] Address review: docstrings for execute_plugin and new WIFICANARY tests execute_plugin's leading description comment becomes a docstring, as it was touched by this PR; the two new check_trusted_aps tests get docstrings instead of leading comments. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PzCQWQVz9b2UzqLiGp2mPM --- server/plugin.py | 3 ++- test/plugins/test_wificanary.py | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/plugin.py b/server/plugin.py index 7397b2c22..4c293ee67 100755 --- a/server/plugin.py +++ b/server/plugin.py @@ -386,8 +386,9 @@ def run_plugin(command, set_RUN_TIMEOUT, plugin): # ------------------------------------------------------------------------------- -# Executes the plugin command specified in the setting with the function specified as CMD def execute_plugin(db, all_plugins, plugin): + """Run the plugin's CMD setting (script or SQL), then load its result files - + including ones received from sync nodes - into the plugin tables.""" sql = db.sql # ------- necessary settings check -------- diff --git a/test/plugins/test_wificanary.py b/test/plugins/test_wificanary.py index dce6ea3d3..2f26218a3 100644 --- a/test/plugins/test_wificanary.py +++ b/test/plugins/test_wificanary.py @@ -408,9 +408,9 @@ def test_two_trusted_bssids_same_ssid_no_false_positive(): def test_out_of_range_extender_does_not_make_clone_absent_baseline(): - # Main AP + extender, each its own entry; only the main AP is in range. - # An open clone is a plain evil twin - the protected network is up, so - # the out-of-range extender must not also raise absent_baseline_clone. + """With a main AP + extender trusted and only the main AP in range, an open + clone is a plain evil_twin - the out-of-range extender must not also raise + absent_baseline_clone, since the protected network is up.""" trusted = [ {'ssid': 'HomeWiFi', 'bssid': 'aa:bb:cc:11:22:33', 'security_set': {'wpa2', 'wpa3'}}, {'ssid': 'HomeWiFi', 'bssid': '44:55:66:aa:bb:cc', 'security_set': {'wpa2', 'wpa3'}}, @@ -424,8 +424,9 @@ def test_out_of_range_extender_does_not_make_clone_absent_baseline(): def test_clone_with_every_trusted_radio_absent_is_absent_baseline(): - # Same pair, neither radio in range - now the clone really is standing - # in for a missing baseline. + """With neither trusted radio of the pair in range, a weaker clone is + flagged as absent_baseline_clone - it really is standing in for a missing + baseline.""" trusted = [ {'ssid': 'HomeWiFi', 'bssid': 'aa:bb:cc:11:22:33', 'security_set': {'wpa2', 'wpa3'}}, {'ssid': 'HomeWiFi', 'bssid': '44:55:66:aa:bb:cc', 'security_set': {'wpa2', 'wpa3'}},