Standardize matching test files structure, add test_main.py and test_commands.py, and update GEMINI.md

This commit is contained in:
venus
2026-07-17 01:55:44 -05:00
parent cf21abe0bc
commit c069e51263
9 changed files with 173 additions and 40 deletions

18
tests/test_main.py Normal file
View File

@@ -0,0 +1,18 @@
import sys
import pytest
from unittest.mock import patch
from ctf.main import main
def test_main_entry_point_help():
"""
Verifies that calling main() executes the Click CLI app and responds
to '--help' by listing registration groups.
"""
# Mock sys.argv to simulate running 'ctf --help' from the shell
with patch.object(sys, "argv", ["ctf", "--help"]):
# Click calls sys.exit() after displaying help, raising SystemExit
with pytest.raises(SystemExit) as exc_info:
main()
# Verify it exits with a successful exit code (0)
assert exc_info.value.code == 0