mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
- Updated the VitePress configuration to include links to CLI commands in both English and Chinese. - Enhanced the AstrBot deployment documentation with instructions for installing it as a system service. - Created comprehensive CLI commands documentation covering initialization, service management, configuration, and plugin management. - Added tests for CLI command aliases and service functionalities to ensure proper command registration and behavior. - Implemented service log management features, including enabling application logging and controlling log visibility.
26 lines
772 B
Python
26 lines
772 B
Python
from click.testing import CliRunner
|
|
|
|
from astrbot.cli.__main__ import cli
|
|
|
|
|
|
def test_top_level_help_uses_product_command_names():
|
|
result = CliRunner().invoke(cli, ["help"])
|
|
|
|
assert result.exit_code == 0
|
|
assert "config" in result.output
|
|
assert "plugin" in result.output
|
|
assert " conf " not in result.output
|
|
assert " plug " not in result.output
|
|
|
|
|
|
def test_legacy_config_and_plugin_aliases_still_work():
|
|
runner = CliRunner()
|
|
|
|
config_result = runner.invoke(cli, ["help", "conf"])
|
|
plugin_result = runner.invoke(cli, ["help", "plug"])
|
|
|
|
assert config_result.exit_code == 0
|
|
assert "Configuration management commands" in config_result.output
|
|
assert plugin_result.exit_code == 0
|
|
assert "Plugin management" in plugin_result.output
|