test/cli: cover selection, slash commands, and providers list

This commit is contained in:
2026-07-14 18:29:46 +08:00
parent e1f71e7828
commit 566c1d7d4d
3 changed files with 194 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
from __future__ import annotations
from pathlib import Path
from click.testing import CliRunner
from plyngent.cli.app import main
def test_providers_list() -> None:
config = Path(__file__).resolve().parents[1] / "test_config" / "plyngent-valid.toml"
runner = CliRunner()
result = runner.invoke(main, ["providers", "--config", str(config)])
assert result.exit_code == 0
assert "test1" in result.output
assert "openai" in result.output
def test_help() -> None:
runner = CliRunner()
result = runner.invoke(main, ["--help"])
assert result.exit_code == 0
assert "chat" in result.output