Since the built-in defaults were seeded into threshold_configs, the legacy top-level thresholds: format was silently ignored. get_thresholds_for_host now uses it whenever it was configured. Tests: point imports at hbd.server/hbd.common, rewrite the DNS worker, proto, datagram and threshold tests for the current API, add pytest-asyncio to the dev extras and set testpaths so a bare pytest runs cleanly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
15 lines
366 B
Python
15 lines
366 B
Python
from hbd.server.udp import parse_message
|
|
from hbd.common.proto import dicttos
|
|
|
|
|
|
def test_parse_message_uncompressed():
|
|
raw = dicttos("HTB", {"name": "host", "interval": 1})
|
|
m = parse_message(raw)
|
|
assert m["ID"].startswith("HTB")
|
|
|
|
|
|
def test_parse_message_compressed():
|
|
raw = dicttos("ACK", {"time": 1})
|
|
m = parse_message(raw)
|
|
assert "ID" in m
|