From 8bb7bcbb67db573b7441806bb905b44154124e7c Mon Sep 17 00:00:00 2001 From: Brian Krabach Date: Tue, 31 Mar 2026 14:35:45 -0700 Subject: [PATCH] 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 --- muxplex/cli.py | 3 ++- muxplex/tests/test_cli.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/muxplex/cli.py b/muxplex/cli.py index e4f1a45..74ee75e 100644 --- a/muxplex/cli.py +++ b/muxplex/cli.py @@ -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) diff --git a/muxplex/tests/test_cli.py b/muxplex/tests/test_cli.py index 9bf4244..8899edc 100644 --- a/muxplex/tests/test_cli.py +++ b/muxplex/tests/test_cli.py @@ -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