Prepare CmdForge 0.2.0 for PyPI

This commit is contained in:
rob
2026-07-21 15:19:02 -03:00
parent ca6135ac72
commit 1e698996b2
12 changed files with 342 additions and 25 deletions
+19
View File
@@ -1,10 +1,13 @@
"""Behavioral coverage for registry-aware picker and deprecation UX."""
from io import StringIO
import sys
import time
from unittest.mock import patch
import cmdforge.cli.picker as picker
import pytest
from cmdforge import __version__
from cmdforge.cli.picker import PickerResult
@@ -89,3 +92,19 @@ def test_local_deprecation_selection_prints_migration_guidance():
output = picker._ui_out.getvalue()
assert "Moved." in output
assert "official/new" in output
def test_picker_help_does_not_require_a_terminal(capsys):
with patch.object(sys, "argv", ["cf", "--help"]), pytest.raises(SystemExit) as exc:
picker.main()
assert exc.value.code == 0
assert "Interactively find and run" in capsys.readouterr().out
def test_picker_version_does_not_require_a_terminal(capsys):
with patch.object(sys, "argv", ["cf", "--version"]), pytest.raises(SystemExit) as exc:
picker.main()
assert exc.value.code == 0
assert f"cf {__version__}" in capsys.readouterr().out