18 lines
452 B
Python
18 lines
452 B
Python
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()
|
|
|