MCPcopy Create free account
hub / github.com/cdgriffith/Box / test_multiline_string_json_options

Function test_multiline_string_json_options

test/test_json_lines_strings.py:41–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40
41def test_multiline_string_json_options():
42 values = BoxList([{"b": 2, "a": 1}, {"c": 3}])
43 text = values.to_json(multiline=True, sort_keys=True, separators=(",", ":"))
44
45 assert text == '{"a":1,"b":2}\n{"c":3}'
46 assert BoxList.from_json(text, multiline=True, parse_int=str) == [{"a": "1", "b": "2"}, {"c": "3"}]
47
48
49@pytest.mark.parametrize("text", ['{"a": 1}\nnot json', '{"a": 1}\n{"b":'])

Callers

nothing calls this directly

Calls 3

to_jsonMethod · 0.95
BoxListClass · 0.90
from_jsonMethod · 0.45

Tested by

no test coverage detected