Intelliscan / tests /test_reporter.py
simoox's picture
Upload 204 files
5e0bd20 verified
Raw
History Blame Contribute Delete
701 Bytes
"""Smoke tests for the Reporter module."""
from pathlib import Path
from intelliscan.modules.reporter import Reporter
def test_pdf_generation(sample_labeled_results, tmp_path):
out = tmp_path / "report.pdf"
rep = Reporter(target="http://localhost:8080", results=sample_labeled_results)
path = rep.build(out)
assert Path(path).exists()
assert Path(path).stat().st_size > 1000 # non-empty PDF
def test_stats_by_severity(sample_labeled_results):
rep = Reporter(target="http://localhost:8080", results=sample_labeled_results)
stats = rep._stats_by_severity()
# We have 3 VULNERABLE entries (sqli, xss_r, lfi) - all HIGH or MEDIUM
assert sum(stats.values()) == 3