Prepare CmdForge 0.2.0 for PyPI
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user