mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-09-22 20:46:20 +00:00
* feat(capabilities): unify catalog, plugin configuration and agent selection * fix(capabilities): address review isolation, validation and demo issues * fix(capabilities): preserve concurrent selections and guide launcher repair
28 lines
1010 B
Python
28 lines
1010 B
Python
"""Capability discovery must offload manifest and integration storage reads."""
|
|
|
|
from types import SimpleNamespace
|
|
|
|
import pytest
|
|
|
|
from app.gateway.capabilities import AdapterContext, MCPAdapter
|
|
from app.gateway.routers import capabilities
|
|
from deerflow.config.extensions_config import ExtensionsConfig
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_catalog_reads_files_off_loop():
|
|
result = await capabilities.catalog()
|
|
assert any(entry.id == "github" for entry in result)
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_installation_discovery_reads_files_off_loop(tmp_path, monkeypatch):
|
|
path = tmp_path / "extensions_config.json"
|
|
import asyncio
|
|
|
|
await asyncio.to_thread(path.write_text, '{"mcpServers":{"sample":{"enabled":false}},"skills":{}}')
|
|
monkeypatch.setattr(ExtensionsConfig, "resolve_config_path", lambda *args: path)
|
|
context = AdapterContext(SimpleNamespace(), SimpleNamespace(), "default")
|
|
result = await MCPAdapter().list_installations(context)
|
|
assert result[0].name == "sample"
|