全局重命名: - 包名: 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 AgentReach core class."""
|
|
|
|
import pytest
|
|
from agent_reach.config import Config
|
|
from agent_reach.core import AgentReach
|
|
|
|
|
|
@pytest.fixture
|
|
def eyes(tmp_path):
|
|
config = Config(config_path=tmp_path / "config.yaml")
|
|
return AgentReach(config=config)
|
|
|
|
|
|
class TestAgentReach:
|
|
def test_init(self, eyes):
|
|
assert eyes.config is not None
|
|
|
|
def test_detect_platform(self, eyes):
|
|
assert eyes.detect_platform("https://github.com/test/repo") == "github"
|
|
assert eyes.detect_platform("https://reddit.com/r/test") == "reddit"
|
|
assert eyes.detect_platform("https://x.com/user/status/123") == "twitter"
|
|
assert eyes.detect_platform("https://youtube.com/watch?v=abc") == "youtube"
|
|
assert eyes.detect_platform("https://bilibili.com/video/BV1xx") == "bilibili"
|
|
assert eyes.detect_platform("https://example.com") == "web"
|
|
|
|
def test_doctor(self, eyes):
|
|
results = eyes.doctor()
|
|
assert isinstance(results, dict)
|
|
assert "web" in results
|
|
assert "github" in results
|
|
|
|
def test_doctor_report(self, eyes):
|
|
report = eyes.doctor_report()
|
|
assert isinstance(report, str)
|
|
assert "Agent Reach" in report
|