()
| 39 | |
| 40 | |
| 41 | def 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":']) |