Added executable root launcher for audita

This commit is contained in:
2026-04-21 10:19:39 -05:00
parent e10349302f
commit 8f6c721f06
7 changed files with 87 additions and 7 deletions

12
tests/test_cli.py Normal file
View File

@@ -0,0 +1,12 @@
import pytest
from audita.cli import main
def test_cli_help_uses_audita_program_name(capsys):
with pytest.raises(SystemExit) as exc:
main(["--help"])
assert exc.value.code == 0
assert capsys.readouterr().out.startswith("usage: audita ")

31
tests/test_launcher.py Normal file
View File

@@ -0,0 +1,31 @@
import os
import shutil
import subprocess
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[1]
LAUNCHER = ROOT / "audita"
def test_root_launcher_exists_and_is_executable():
assert LAUNCHER.is_file()
assert os.access(LAUNCHER, os.X_OK)
def test_root_launcher_help_smoke():
if shutil.which("uv") is None:
pytest.skip("uv is not installed")
result = subprocess.run(
[str(LAUNCHER), "--help"],
cwd=ROOT,
text=True,
capture_output=True,
check=False,
)
assert result.returncode == 0
assert result.stdout.startswith("usage: audita ")