- 更新 Gitea runner 配置,支持优化的 CI/CD 环境 - 完善 Harbor HTTPS 配置和远程访问支持 - 优化 Harbor 日志配置,改用 json-file 驱动 - 添加 Docker 构建加速和代理缓存脚本 - 新增完整的文档和使用指南 - 添加 AI 开发工具集成配置 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
55 lines
1.3 KiB
Python
55 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""测试交互式功能"""
|
|
|
|
import subprocess
|
|
import sys
|
|
import os
|
|
|
|
def test_interactive():
|
|
# 设置环境
|
|
env = os.environ.copy()
|
|
env['PATH'] = os.path.expanduser('~/.local/bin') + ':' + env['PATH']
|
|
|
|
# 测试命令
|
|
test_commands = [
|
|
'help',
|
|
'写一个 Hello World 程序',
|
|
'/status',
|
|
'/quit'
|
|
]
|
|
|
|
try:
|
|
# 启动交互式脚本
|
|
proc = subprocess.Popen(
|
|
[sys.executable, '/Users/brunogao/work/codes/tools/macos/ai/claude-qwen-interactive.py'],
|
|
stdin=subprocess.PIPE,
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.STDOUT,
|
|
text=True,
|
|
env=env
|
|
)
|
|
|
|
# 发送测试命令
|
|
for cmd in test_commands:
|
|
proc.stdin.write(cmd + '\n')
|
|
proc.stdin.flush()
|
|
|
|
# 等待输出
|
|
output, _ = proc.communicate(timeout=60)
|
|
|
|
print("=== 交互式测试结果 ===")
|
|
print(output)
|
|
print("=== 测试完成 ===")
|
|
|
|
return "Claude-Qwen Interactive Mode" in output
|
|
|
|
except Exception as e:
|
|
print(f"测试失败: {e}")
|
|
return False
|
|
|
|
if __name__ == "__main__":
|
|
success = test_interactive()
|
|
if success:
|
|
print("✅ 交互式功能测试成功!")
|
|
else:
|
|
print("❌ 交互式功能测试失败") |