0a9ff16dfc
v3 rewrites the search engine from the ground up: - Intelligent pre-research: resolves X handles, GitHub repos, subreddits, TikTok hashtags, and YouTube channels before searching - GitHub person-mode: PR velocity, top repos by stars, release notes - GitHub project-mode: live star counts, README, releases, top issues - ELI5 mode: plain language synthesis, no jargon - 13+ sources: Reddit, X, YouTube, TikTok, Instagram, HN, Polymarket, GitHub, Threads, Pinterest, Perplexity, Bluesky, Web - Free Reddit comments via public JSON (no API key needed) - Fun judge v2: humor scoring baked into narrative - Cookie consent before browser scanning - 10,000 free ScrapeCreators calls - 1,012 tests Thank you to the community contributors whose issues and PRs shaped v3: @uppinote20 (#143), @zerone0x (#134, #136), @thinkun (#116), @thomasmktong (#124), @fanispoulinakisai-boop (#100), @pejmanjohn (#78), @zl190 (#115), @hnshah (#84, #85, #86) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
1.3 KiB
Python
36 lines
1.3 KiB
Python
import sys
|
|
import tempfile
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
|
|
|
import briefing
|
|
import store
|
|
|
|
|
|
class BriefingV3Tests(unittest.TestCase):
|
|
def test_generate_daily_uses_utc_for_last_run(self):
|
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
db_path = Path(tmpdir) / "research.db"
|
|
briefs_dir = Path(tmpdir) / "briefs"
|
|
old_db_override = store._db_override
|
|
old_briefs_dir = briefing.BRIEFS_DIR
|
|
try:
|
|
store._db_override = db_path
|
|
briefing.BRIEFS_DIR = briefs_dir
|
|
topic = store.add_topic("test topic")
|
|
store.record_run(topic["id"], source_mode="v3", status="completed")
|
|
result = briefing.generate_daily()
|
|
self.assertEqual(result["status"], "ok")
|
|
self.assertEqual(result["topics"][0]["name"], "test topic")
|
|
self.assertIsNotNone(result["topics"][0]["hours_ago"])
|
|
self.assertGreaterEqual(result["topics"][0]["hours_ago"], 0.0)
|
|
finally:
|
|
store._db_override = old_db_override
|
|
briefing.BRIEFS_DIR = old_briefs_dir
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|