Refactor AI daily report pipeline
This commit is contained in:
17
tests/test_llm_utils.py
Normal file
17
tests/test_llm_utils.py
Normal 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()
|
||||
|
||||
Reference in New Issue
Block a user