mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-10 22:38:40 +03:00
test(plugins): isolate setup process
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@@ -113,6 +114,10 @@ def test_agent_plugin_reuses_mcp_catalog_and_runtime_action(
|
|||||||
) -> None:
|
) -> None:
|
||||||
_use_config(tmp_path, monkeypatch)
|
_use_config(tmp_path, monkeypatch)
|
||||||
_write_agent_plugin(load_config().workspace_path)
|
_write_agent_plugin(load_config().workspace_path)
|
||||||
|
monkeypatch.setattr(
|
||||||
|
"nanobot.agent.plugins.subprocess.run",
|
||||||
|
lambda command, **_: subprocess.CompletedProcess(command, 0, "", ""),
|
||||||
|
)
|
||||||
|
|
||||||
row = next(item for item in mcp_presets_payload()["presets"] if item["source"] == "agent-plugin")
|
row = next(item for item in mcp_presets_payload()["presets"] if item["source"] == "agent-plugin")
|
||||||
assert row["name"] == "plugin-desktop"
|
assert row["name"] == "plugin-desktop"
|
||||||
|
|||||||
Reference in New Issue
Block a user