修正北京时间并更换新闻候选源
This commit is contained in:
@@ -5,18 +5,22 @@ from app.integrations.news_search_client import NewsSearchClient
|
||||
def test_news_search_client_maps_article_to_candidate() -> None:
|
||||
# 新闻搜索结果会先转为候选信号,再交给模型筛选成最终情报。
|
||||
client = NewsSearchClient(Settings())
|
||||
signal = client._article_to_signal(
|
||||
signal = client._story_to_signal(
|
||||
{
|
||||
"title": "AI agent platform launches",
|
||||
"title": "Show HN: AI agent platform launches",
|
||||
"url": "https://example.com/ai-agent-platform",
|
||||
"domain": "example.com",
|
||||
"sourcecountry": "US",
|
||||
"seendate": "20260708T120000Z",
|
||||
"author": "builder",
|
||||
"points": 128,
|
||||
"num_comments": 24,
|
||||
"created_at": "2026-07-08T12:00:00Z",
|
||||
"objectID": "123",
|
||||
}
|
||||
)
|
||||
|
||||
assert signal is not None
|
||||
assert signal.topic == "AI 新闻候选"
|
||||
assert signal.source_name == "example.com"
|
||||
assert signal.source_name == "Hacker News"
|
||||
assert signal.published_at is not None
|
||||
assert signal.published_at.year == 2026
|
||||
assert signal.published_at.hour == 20
|
||||
assert "128 points" in signal.summary
|
||||
|
||||
Reference in New Issue
Block a user