test: add deprecation warning test for install-service subcommand

- Add test_install_service_subcommand_prints_deprecation_warning to
  verify that 'muxplex install-service' prints a deprecation warning
  to stderr containing 'deprecated' and 'muxplex service install'
- Update the deprecation warning message in main() to include
  'muxplex service install' as the recommended replacement command

Refs: task-4
This commit is contained in:
Brian Krabach
2026-03-31 14:35:45 -07:00
parent 03e9dc66de
commit 8bb7bcbb67
2 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -723,7 +723,8 @@ def main() -> None:
import sys
print(
"Warning: 'install-service' is deprecated and will be removed in a future version.",
"Warning: 'install-service' is deprecated and will be removed in a future version."
" Use 'muxplex service install' instead.",
file=sys.stderr,
)
install_service(system=args.system)
+13
View File
@@ -969,6 +969,19 @@ def test_main_serve_subcommand_accepts_flags():
)
def test_install_service_subcommand_prints_deprecation_warning(capsys):
"""'muxplex install-service' must print a deprecation warning to stderr."""
from muxplex.cli import main
with patch("muxplex.cli.install_service"):
with patch("sys.argv", ["muxplex", "install-service"]):
main()
captured = capsys.readouterr()
assert "deprecated" in captured.err.lower()
assert "muxplex service install" in captured.err
def test_help_shows_single_upgrade_line():
"""Help output shows 'upgrade (update)' alias notation, not two separate subcommand entries."""
import io