全局重命名: - 包名: 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 全部正常。
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""Tests for doctor module."""
|
|
|
|
import pytest
|
|
from agent_reach.config import Config
|
|
from agent_reach.doctor import check_all, format_report
|
|
|
|
|
|
@pytest.fixture
|
|
def tmp_config(tmp_path):
|
|
return Config(config_path=tmp_path / "config.yaml")
|
|
|
|
|
|
class TestDoctor:
|
|
def test_zero_config_channels_ok(self, tmp_config):
|
|
results = check_all(tmp_config)
|
|
assert results["web"]["status"] == "ok"
|
|
assert results["github"]["status"] == "ok"
|
|
assert results["bilibili"]["status"] in ("ok", "warn") # warn on servers
|
|
assert results["rss"]["status"] == "ok"
|
|
|
|
def test_exa_off_without_key(self, tmp_config):
|
|
results = check_all(tmp_config)
|
|
assert results["exa_search"]["status"] == "off"
|
|
|
|
def test_exa_on_with_key(self, tmp_config):
|
|
tmp_config.set("exa_api_key", "test-key")
|
|
results = check_all(tmp_config)
|
|
assert results["exa_search"]["status"] == "ok"
|
|
|
|
def test_format_report(self, tmp_config):
|
|
results = check_all(tmp_config)
|
|
report = format_report(results)
|
|
assert "Agent Reach" in report
|
|
assert "✅" in report
|
|
assert "渠道可用" in report
|