"""Tests for CLI.""" import os import subprocess import sys from pathlib import Path ROOT = Path(__file__).resolve().parent.parent ENV = {**os.environ, "PYTHONPATH": str(ROOT / "src")} def test_cli_help(): """--help returns 0 and contains 'verify'.""" result = subprocess.run( [sys.executable, "-m", "hdk.cli", "--help"], capture_output=True, text=True, env=ENV, cwd=ROOT, ) assert result.returncode == 0 assert "verify" in result.stdout assert "hdk-audit" in result.stdout def test_cli_version(): """version command returns 0 and shows '0.1.3'.""" result = subprocess.run( [sys.executable, "-m", "hdk.cli", "version"], capture_output=True, text=True, env=ENV, cwd=ROOT, ) assert result.returncode == 0 assert "0.1.3" in result.stdout