27 lines
1,001 B
Python
27 lines
1,001 B
Python
"""Tests for `agnes diagnose system` (former `agnes status` content)."""
|
|
|
|
from typer.testing import CliRunner
|
|
from cli.commands.diagnose import diagnose_app
|
|
|
|
runner = CliRunner()
|
|
|
|
|
|
def test_diagnose_system_help():
|
|
result = runner.invoke(diagnose_app, ["system", "--help"])
|
|
assert result.exit_code == 0
|
|
|
|
|
|
def test_diagnose_help_lists_system():
|
|
"""Top-level diagnose help should mention the `system` subcommand."""
|
|
result = runner.invoke(diagnose_app, ["--help"])
|
|
assert result.exit_code == 0
|
|
assert "system" in result.output
|
|
|
|
|
|
def test_diagnose_default_still_works():
|
|
"""`agnes diagnose` (no subcommand) should still produce its existing output —
|
|
we only added a sibling subcommand, didn't change the default."""
|
|
result = runner.invoke(diagnose_app, [])
|
|
# Either runs successfully or fails for unrelated reasons (no server etc).
|
|
# We just want to verify no traceback from the addition.
|
|
assert "Traceback" not in (result.output + (result.stderr or ""))
|