scan with --output writes report to file.
(tmp_path: Path)
| 45 | |
| 46 | |
| 47 | def test_cli_scan_output_to_file(tmp_path: Path) -> None: |
| 48 | """scan with --output writes report to file.""" |
| 49 | skill_dir = tmp_path / "skill" |
| 50 | skill_dir.mkdir() |
| 51 | (skill_dir / "SKILL.md").write_text("---\nname: out-test\n---\n# Hi", encoding="utf-8") |
| 52 | out_file = tmp_path / "report.json" |
| 53 | result = runner.invoke( |
| 54 | app, ["scan", str(skill_dir), "--format", "json", "--no-llm", "--output", str(out_file)] |
| 55 | ) |
| 56 | assert result.exit_code == 0 |
| 57 | assert out_file.exists() |
| 58 | content = out_file.read_text() |
| 59 | assert "out-test" in content or "risk_assessment" in content |
| 60 | |
| 61 | |
| 62 | def test_cli_scan_no_llm(tmp_path: Path) -> None: |