docs: 更新 Agent 技能与 env 示例以支持 Delta 模式
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -188,3 +188,61 @@ class PushGateTests(unittest.TestCase):
|
||||
)
|
||||
self.assertTrue(gate.should_push)
|
||||
self.assertIn("force_push", gate.reasons)
|
||||
|
||||
|
||||
class WebhookSilentTests(unittest.TestCase):
|
||||
def test_skip_when_silent(self):
|
||||
import json
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
from daily.webhook import should_skip_push
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root = Path(tmp)
|
||||
data = root / "2026-07-10.data.json"
|
||||
data.write_text(
|
||||
json.dumps(
|
||||
{"meta": {"push_gate": {"should_push": False, "silent": True, "reasons": []}}}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
report = root / "2026-07-10.wecom.md"
|
||||
report.write_text("📰 test", encoding="utf-8")
|
||||
self.assertTrue(should_skip_push(report))
|
||||
|
||||
|
||||
class E2ESmokeTests(unittest.TestCase):
|
||||
def test_delta_mode_no_full_top_label(self):
|
||||
from daily.format_wecom import replace_wecom_board_sections
|
||||
|
||||
md = "📰 **早报 · 2026-07-10**\n\n🌍 **国际 AI · 精选 1**\n1. [x](https://a.com)\n"
|
||||
movement = {
|
||||
"skills_trending_moves": [
|
||||
{
|
||||
"id": "a/b/c",
|
||||
"rank": 2,
|
||||
"title": "c",
|
||||
"source": "a/b",
|
||||
"installs": 1,
|
||||
"link": "https://skills.sh/a/b/c",
|
||||
"description": "d",
|
||||
}
|
||||
],
|
||||
"skills_hot_moves": [],
|
||||
"github_trending_moves": [],
|
||||
"github_emerging_moves": [],
|
||||
"github_topic_moves": [],
|
||||
}
|
||||
with patch("daily.format_wecom.localize_brief_descriptions", return_value={}):
|
||||
with patch("daily.format_wecom.needs_chinese", return_value=False):
|
||||
out = replace_wecom_board_sections(
|
||||
md,
|
||||
mode="delta",
|
||||
movement=movement,
|
||||
trending=[],
|
||||
hot=[],
|
||||
topic_name="llm",
|
||||
)
|
||||
self.assertIn("Skills Trending 变化", out)
|
||||
self.assertNotIn("Skills Trending Top", out)
|
||||
|
||||
Reference in New Issue
Block a user