Refactor AI daily report pipeline

This commit is contained in:
Mimikko-zeus
2026-06-04 15:21:56 +08:00
parent 94e18ce22d
commit 5a98696255
64 changed files with 4778 additions and 1316 deletions

17
tests/test_llm_utils.py Normal file
View File

@@ -0,0 +1,17 @@
import unittest
from ai_daily_report.llm import parse_json_object
class LlmUtilsTests(unittest.TestCase):
def test_parse_json_object_strips_markdown_fence(self):
self.assertEqual(parse_json_object('```json\n{"ok": true}\n```'), {"ok": True})
def test_parse_json_object_raises_without_json(self):
with self.assertRaises(ValueError):
parse_json_object("not json")
if __name__ == "__main__":
unittest.main()