Title: Implement minimal core framework with PL injection and update build config
Key features implemented: - Updated package metadata and dependencies in PKG-INFO, setup files - Added main.py entry point for backward compatibility with README launch method - Enhanced CLI with config options, system info command, and proper signal handling - Implemented minimal PluginManager loading only plugin-loader core plugin - Refactored PluginLoader to follow minimal core design, removed sandbox/isolation complexity - Updated auto-dependency plugin with safer PL injection mechanism and disabled pl_injection - Removed legacy plugin files (firewall, frp_proxy, ftp_server, multi_lang_deploy, ops_toolbox, security_gateway) as functionality moved to core plugin system - Improved gitignore with comprehensive ignore patterns The changes implement a minimal core framework design where only the plugin-loader is directly loaded by the core, with all other plugins managed through the PL injection mechanism, significantly simplifying the architecture.
This commit is contained in:
39
tests/test_cli.py
Normal file
39
tests/test_cli.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""CLI 命令单元测试"""
|
||||
import pytest
|
||||
from click.testing import CliRunner
|
||||
from oss.cli import cli, version, serve
|
||||
|
||||
|
||||
class TestCLI:
|
||||
"""测试 CLI 命令"""
|
||||
|
||||
def test_version_command(self):
|
||||
"""测试版本命令"""
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(version)
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "Future OSS" in result.output
|
||||
assert "1.2.0" in result.output
|
||||
|
||||
def test_cli_help(self):
|
||||
"""测试 CLI 帮助信息"""
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ['--help'])
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "Future OSS" in result.output
|
||||
assert "serve" in result.output
|
||||
assert "version" in result.output
|
||||
|
||||
def test_serve_command_exists(self):
|
||||
"""测试 serve 命令存在"""
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(serve, ['--help'])
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "启动 Future OSS" in result.output
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pytest.main([__file__, "-v"])
|
||||
Reference in New Issue
Block a user