MCPcopy Create free account
hub / github.com/cactus-compute/needle / test_parse_array_variants

Function test_parse_array_variants

tests/test_generate.py:7–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def test_parse_array_variants():
8 from needle.model.finetune import _parse_array
9
10 assert len(_parse_array('[{"query":"q","answers":[]}]')) == 1
11 assert len(_parse_array('Sure!\n[{"query":"q","answers":[]}]\nDone.')) == 1
12 assert _parse_array("no array at all") == []
13 assert _parse_array("[not valid json]") == []
14
15 mixed = '[{"query":"q","answers":[]},{"nope":1},{"query":"only"}]'
16 assert len(_parse_array(mixed)) == 1
17
18
19def test_collect_tools_dedups_by_name():

Callers

nothing calls this directly

Calls 1

_parse_arrayFunction · 0.90

Tested by

no test coverage detected