Files
Agent-Reach/tests/test_doctor.py
T
Panniantong 904f8dfb49 fix: doctor status must be honest — show real capability per channel
Before: everything under tier 0 showed  with vague descriptions
After: each channel shows its actual capability and limitations

Changes:
- GitHub: 'Public repos only. Set github_token for private repos'
- Twitter: shows 'Full access' vs 'Read-only' depending on birdx
- Bilibili: ⚠️ warning on servers about potential IP blocks
- XiaoHongShu: friendly message when no cookie (was showing Jina 451)
- Doctor format: tier 0 items now show detailed status messages, not just 
- README: platform table updated to match reality (removed exaggerated claims)
- README: doctor example updated to show new honest format
2026-02-24 09:00:34 +01:00

37 lines
1.2 KiB
Python

# -*- coding: utf-8 -*-
"""Tests for doctor module."""
import pytest
from agent_eyes.config import Config
from agent_eyes.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 Eyes" in report
assert "" in report
assert "channels active" in report