全局重命名: - 包名: agent_eyes → agent_reach - CLI: agent-eyes → agent-reach - 类名: AgentEyes → AgentReach - 显示名: Agent Eyes → Agent Reach - GitHub: Panniantong/agent-eyes → Panniantong/Agent-Reach 所有 36 个测试通过,CLI/doctor/read/search 全部正常。
29 lines
914 B
Python
29 lines
914 B
Python
# -*- coding: utf-8 -*-
|
|
"""Tests for Agent Reach CLI."""
|
|
|
|
import pytest
|
|
from unittest.mock import patch
|
|
from agent_reach.cli import main
|
|
|
|
|
|
class TestCLI:
|
|
def test_version(self, capsys):
|
|
with pytest.raises(SystemExit) as exc_info:
|
|
with patch("sys.argv", ["agent-reach", "version"]):
|
|
main()
|
|
assert exc_info.value.code == 0
|
|
captured = capsys.readouterr()
|
|
assert "Agent Reach v" in captured.out
|
|
|
|
def test_no_command_shows_help(self, capsys):
|
|
with pytest.raises(SystemExit) as exc_info:
|
|
with patch("sys.argv", ["agent-reach"]):
|
|
main()
|
|
assert exc_info.value.code == 0
|
|
|
|
def test_doctor_runs(self, capsys):
|
|
with patch("sys.argv", ["agent-reach", "doctor"]):
|
|
main()
|
|
captured = capsys.readouterr()
|
|
assert "Agent Reach" in captured.out
|
|
assert "✅" in captured.out
|