Download tests/test_cli.py from JakCwi/HDK-audit: direct link, hf CLI and curl.
- Browser
- Download file 832 Bytes
-
https://huggingface.co/JakCwi/HDK-audit/resolve/main/tests/test_cli.py
- Command line
-
hf download hf://JakCwi/HDK-audit/tests/test_cli.py
-
curl -L -o test_cli.py https://huggingface.co/JakCwi/HDK-audit/resolve/main/tests/test_cli.py
832 Bytes
| """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 | |