MCPcopy Create free account
hub / github.com/NVIDIA/SkillSpector / test_cli_scan_output_to_file

Function test_cli_scan_output_to_file

tests/unit/test_cli.py:47–59  ·  view source on GitHub ↗

scan with --output writes report to file.

(tmp_path: Path)

Source from the content-addressed store, hash-verified

45
46
47def 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
62def test_cli_scan_no_llm(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 1

invokeMethod · 0.45

Tested by

no test coverage detected