docs: 为全部代码补充中文注释并加入 AGENTS 注释规范

This commit is contained in:
cat-shark
2026-08-13 22:09:55 +08:00
parent 77e9ac6b7e
commit ac41a9a6da
29 changed files with 472 additions and 2 deletions
+9
View File
@@ -1,3 +1,9 @@
"""种子数据测试。
验证启动种子逻辑会注册节点仓库、创建演示工作流且保持幂等,并验证
开启种子与调度器后的应用生命周期。
"""
from pathlib import Path
from fastapi.testclient import TestClient
@@ -10,6 +16,7 @@ WORKSPACE = Path(__file__).resolve().parent.parent.parent
def test_seed_nodes_and_demo_workflow(tmp_path) -> None:
"""验证 seed_nodes 注册节点、seed_demo_workflow 创建演示流程且幂等。"""
db = Database(tmp_path / "wov.db")
seed_nodes(db, WORKSPACE)
node_ids = [node.id for node in db.list_nodes()]
@@ -27,10 +34,12 @@ def test_seed_nodes_and_demo_workflow(tmp_path) -> None:
empty_workspace = tmp_path / "empty"
(empty_workspace / "wov-node-empty").mkdir(parents=True)
# 目录存在但没有 manifest 时不应报错。
seed_nodes(db, empty_workspace)
def test_lifespan_with_seed_and_scheduler(monkeypatch) -> None:
"""验证启用自动种子与调度器后应用正常启动且 demo 应用可见。"""
monkeypatch.setenv("WOV_AUTO_SEED", "1")
monkeypatch.setenv("WOV_SCHEDULER_ENABLED", "1")
with TestClient(app) as client: