24 lines
753 B
Python
24 lines
753 B
Python
"""Tests for the plugin-accordion visibility filter in http.py."""
|
|
from hbd.server.http import _visible_plugin_names
|
|
|
|
|
|
def test_visible_plugin_names_excludes_rtt_history_keys():
|
|
plugin_data = {
|
|
"cpu_monitor": [],
|
|
"rtt_ipv4": [],
|
|
"rtt_ipv6": [],
|
|
"network_monitor": [],
|
|
}
|
|
result = _visible_plugin_names(plugin_data)
|
|
assert sorted(result) == ["cpu_monitor", "network_monitor"]
|
|
|
|
|
|
def test_visible_plugin_names_empty_when_no_plugins():
|
|
assert _visible_plugin_names({}) == []
|
|
|
|
|
|
def test_visible_plugin_names_keeps_names_not_prefixed_with_rtt_():
|
|
plugin_data = {"nagios_runner": [], "os_info": []}
|
|
result = _visible_plugin_names(plugin_data)
|
|
assert sorted(result) == ["nagios_runner", "os_info"]
|