hades / tests /analyze /test_main_cli.py
Kolgrim's picture
Sync code to latest: per-connection counting, grounded hybrid reports, real-log-style SFT data, eval fixes
954cf0a verified
Raw History Blame Contribute Delete
440 Bytes
from hades.analyze.__main__ import main
def test_cli_without_model_prints_analyzer_report(tmp_path, capsys):
log = tmp_path / "auth.log"
log.write_text("\n".join(f"Jan 1 00:00:0{i} h sshd[{i}]: Failed password for root from 1.2.3.4 port 1 ssh2" for i in range(1, 7)))
assert main([str(log)]) == 0
out = capsys.readouterr().out
assert "VERDICT: brute_force" in out and "6 failed password attempts from 1.2.3.4" in out