feat(news): research 时讯加可信过滤、去重与国内配额
候选池按独立事件拉取,白名单过滤低质源,同事件与 tech 主题去重后按展示上限打包。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,7 +5,24 @@ from __future__ import annotations
|
||||
import unittest
|
||||
|
||||
from daily.format_wecom import _ai_news_lines, replace_wecom_news_sections
|
||||
from daily.news.research import parse_research_response
|
||||
from daily.news.research import (
|
||||
parse_research_response,
|
||||
research_pool_limit,
|
||||
research_tech_pool_limit,
|
||||
)
|
||||
|
||||
|
||||
class TestAiNewsResearchPool(unittest.TestCase):
|
||||
def test_pool_defaults_above_display(self):
|
||||
self.assertEqual(research_pool_limit(10), 20)
|
||||
self.assertEqual(research_tech_pool_limit(5), 10)
|
||||
|
||||
def test_pool_env_override(self):
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
with mock.patch.dict(os.environ, {"DAILY_AI_NEWS_RESEARCH_POOL": "24"}, clear=False):
|
||||
self.assertEqual(research_pool_limit(10), 24)
|
||||
|
||||
|
||||
class TestAiNewsResearchParse(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user