Download tests/analyze/test_main_cli.py from Kolgrim/hades: direct link, hf CLI and curl.
- Browser
- Download file 440 Bytes
-
https://huggingface.co/Kolgrim/hades/resolve/main/tests/analyze/test_main_cli.py
- Command line
-
hf download hf://Kolgrim/hades/tests/analyze/test_main_cli.py
-
curl -L -o test_main_cli.py https://huggingface.co/Kolgrim/hades/resolve/main/tests/analyze/test_main_cli.py
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 | |