MCPcopy Index your code
hub / github.com/microsoft/SkillOpt / test_code_fence_json

Method test_code_fence_json

tests/test_json_utils.py:16–18  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

14 """extract_json — extract a JSON object from LLM response text."""
15
16 def test_code_fence_json(self) -> None:
17 text = 'Some text\n```json\n{"key": "value", "num": 42}\n```\nmore text'
18 assert extract_json(text) == {"key": "value", "num": 42}
19
20 def test_bare_json_object(self) -> None:
21 text = 'The result is {"answer": "yes", "score": 0.95}.'

Callers

nothing calls this directly

Calls 1

extract_jsonFunction · 0.90

Tested by

no test coverage detected