sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)

This commit is contained in:
gozeros committed 2026-10-21 14:51:31 +08:00
1 parent 4f7f07504a
commit 8bc8b0e082
1651 files changed
+278599 -11416

No files matched your search

@@ -0,0 +1,46 @@
from __future__ import annotations
from pathlib import Path
from deerflow.config.app_config import AppConfig
def test_relative_sandbox_mount_is_resolved_from_config_directory(tmp_path: Path) -> None:
knowledge_dir = tmp_path / "knowledge" / "knowledge_base"
knowledge_dir.mkdir(parents=True)
config_path = tmp_path / "config.yaml"
config_path.write_text(
"""
sandbox:
use: deerflow.sandbox.local:LocalSandboxProvider
mounts:
- host_path: knowledge/knowledge_base
container_path: /mnt/knowledge
read_only: true
""".strip(),
encoding="utf-8",
)
config = AppConfig.from_file(str(config_path))
assert config.sandbox.mounts[0].host_path == str(knowledge_dir.resolve())
assert Path(config.sandbox.mounts[0].host_path).is_absolute()
def test_absolute_sandbox_mount_is_preserved(tmp_path: Path) -> None:
absolute_mount = (tmp_path / "shared").resolve()
config_data = {
"sandbox": {
"use": "deerflow.sandbox.local:LocalSandboxProvider",
"mounts": [
{
"host_path": str(absolute_mount),
"container_path": "/mnt/shared",
}
],
}
}
AppConfig._resolve_relative_mount_paths(config_data, tmp_path / "elsewhere")
assert config_data["sandbox"]["mounts"][0]["host_path"] == str(absolute_mount)